diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-11-14 13:15:22 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-11-14 13:20:06 +0000 |
commit | b74c962c9c42267bacd29c104057766f04434fcf (patch) | |
tree | 3cbd2e21d5aba70e7aa58f97d831f031c4ad6bf9 | |
parent | 0d940c92f473a294d6b15e2bf74b3ba92af70b54 (diff) | |
download | alpine_aports-b74c962c9c42267bacd29c104057766f04434fcf.tar.bz2 alpine_aports-b74c962c9c42267bacd29c104057766f04434fcf.tar.xz alpine_aports-b74c962c9c42267bacd29c104057766f04434fcf.zip |
testing/py3-astor: fix packaging with setuptools>=41.4
patch from https://github.com/berkerpeksag/astor/pull/163
-rw-r--r-- | testing/py3-astor/APKBUILD | 6 | ||||
-rw-r--r-- | testing/py3-astor/Fix-packaging-for-setuptools-41.4.patch | 97 |
2 files changed, 101 insertions, 2 deletions
diff --git a/testing/py3-astor/APKBUILD b/testing/py3-astor/APKBUILD index e15e6b026c..7feb38a8a8 100644 --- a/testing/py3-astor/APKBUILD +++ b/testing/py3-astor/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | # Maintainer: | 2 | # Maintainer: |
3 | pkgname=py3-astor | 3 | pkgname=py3-astor |
4 | pkgver=0.8 | 4 | pkgver=0.8 |
5 | pkgrel=1 | 5 | pkgrel=2 |
6 | pkgdesc="Easy manipulation of Python source via the AST" | 6 | pkgdesc="Easy manipulation of Python source via the AST" |
7 | url="https://github.com/berkerpeksag/astor" | 7 | url="https://github.com/berkerpeksag/astor" |
8 | arch="noarch" | 8 | arch="noarch" |
@@ -12,6 +12,7 @@ makedepends="py3-setuptools" | |||
12 | checkdepends="py3-nose" | 12 | checkdepends="py3-nose" |
13 | source="$pkgname-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz | 13 | source="$pkgname-$pkgver.tar.gz::https://github.com/berkerpeksag/astor/archive/$pkgver.tar.gz |
14 | put-2-newlines-between-func-defs.patch | 14 | put-2-newlines-between-func-defs.patch |
15 | Fix-packaging-for-setuptools-41.4.patch | ||
15 | " | 16 | " |
16 | builddir="$srcdir/astor-$pkgver" | 17 | builddir="$srcdir/astor-$pkgver" |
17 | 18 | ||
@@ -28,4 +29,5 @@ package() { | |||
28 | } | 29 | } |
29 | 30 | ||
30 | sha512sums="ca787234f9a9caae37633be289d6e980e7b44507d74306ad7a30f017442d6cf423748ef35465b7b5d12bdb84ce4594af801de39882f4c11c732dba4dc65ab667 py3-astor-0.8.tar.gz | 31 | sha512sums="ca787234f9a9caae37633be289d6e980e7b44507d74306ad7a30f017442d6cf423748ef35465b7b5d12bdb84ce4594af801de39882f4c11c732dba4dc65ab667 py3-astor-0.8.tar.gz |
31 | a1b39b96a4f6b5bf2bd826af8ba88a84a1337f3464a3571b10a566aa0cdd5706f23e02398a4840bfa4b15f120595334441cb870721232047fa45d5ed5b0712df put-2-newlines-between-func-defs.patch" | 32 | a1b39b96a4f6b5bf2bd826af8ba88a84a1337f3464a3571b10a566aa0cdd5706f23e02398a4840bfa4b15f120595334441cb870721232047fa45d5ed5b0712df put-2-newlines-between-func-defs.patch |
33 | 48db3a399bccfbc8a5b8d45974c8508625dc84abd08c31f9f25a222cc5a71082d76bef86210bb13f40b539370f203d55e46e73fc5f19ca2a498b396402661229 Fix-packaging-for-setuptools-41.4.patch" | ||
diff --git a/testing/py3-astor/Fix-packaging-for-setuptools-41.4.patch b/testing/py3-astor/Fix-packaging-for-setuptools-41.4.patch new file mode 100644 index 0000000000..63f57e407f --- /dev/null +++ b/testing/py3-astor/Fix-packaging-for-setuptools-41.4.patch | |||
@@ -0,0 +1,97 @@ | |||
1 | From 30059dac4eb832e58ab2109db84508b294ba366d Mon Sep 17 00:00:00 2001 | ||
2 | From: Jonathan Ringer <jonringer117@gmail.com> | ||
3 | Date: Thu, 17 Oct 2019 16:54:16 -0700 | ||
4 | Subject: [PATCH] Fix packaging for setuptools>=41.4 | ||
5 | |||
6 | --- | ||
7 | MANIFEST.in | 1 + | ||
8 | astor/VERSION | 1 + | ||
9 | astor/__init__.py | 5 ++++- | ||
10 | setup.cfg | 3 ++- | ||
11 | setup.py | 16 +--------------- | ||
12 | 5 files changed, 9 insertions(+), 17 deletions(-) | ||
13 | create mode 100644 astor/VERSION | ||
14 | |||
15 | diff --git a/MANIFEST.in b/MANIFEST.in | ||
16 | index b12a6fe..81e72d5 100644 | ||
17 | --- a/MANIFEST.in | ||
18 | +++ b/MANIFEST.in | ||
19 | @@ -1,3 +1,4 @@ | ||
20 | include README.rst AUTHORS LICENSE CHANGES | ||
21 | include setuputils.py | ||
22 | +include astor/VERSION | ||
23 | recursive-include tests *.py | ||
24 | diff --git a/astor/VERSION b/astor/VERSION | ||
25 | new file mode 100644 | ||
26 | index 0000000..a3df0a6 | ||
27 | --- /dev/null | ||
28 | +++ b/astor/VERSION | ||
29 | @@ -0,0 +1 @@ | ||
30 | +0.8.0 | ||
31 | diff --git a/astor/__init__.py b/astor/__init__.py | ||
32 | index 3b02983..bdedaef 100644 | ||
33 | --- a/astor/__init__.py | ||
34 | +++ b/astor/__init__.py | ||
35 | @@ -9,6 +9,7 @@ | ||
36 | |||
37 | """ | ||
38 | |||
39 | +import os | ||
40 | import warnings | ||
41 | |||
42 | from .code_gen import SourceGenerator, to_source # NOQA | ||
43 | @@ -19,7 +20,9 @@ | ||
44 | from .op_util import symbol_data # NOQA | ||
45 | from .tree_walk import TreeWalk # NOQA | ||
46 | |||
47 | -__version__ = '0.8.0' | ||
48 | +ROOT = os.path.dirname(__file__) | ||
49 | +with open(os.path.join(ROOT, 'VERSION')) as version_file: | ||
50 | + __version__ = version_file.read().strip() | ||
51 | |||
52 | parse_file = code_to_ast.parse_file | ||
53 | |||
54 | diff --git a/setup.cfg b/setup.cfg | ||
55 | index 1baf6fc..a43634f 100644 | ||
56 | --- a/setup.cfg | ||
57 | +++ b/setup.cfg | ||
58 | @@ -2,6 +2,7 @@ | ||
59 | name = astor | ||
60 | description = Read/rewrite/write Python ASTs | ||
61 | long_description = file:README.rst | ||
62 | +version = file: astor/VERSION | ||
63 | author = Patrick Maupin | ||
64 | author_email = pmaupin@gmail.com | ||
65 | platforms = Independent | ||
66 | @@ -40,7 +41,7 @@ test_suite = nose.collector | ||
67 | [options.packages.find] | ||
68 | exclude = tests | ||
69 | |||
70 | -[wheel] | ||
71 | +[bdist_wheel] | ||
72 | universal = 1 | ||
73 | |||
74 | [build-system] | ||
75 | diff --git a/setup.py b/setup.py | ||
76 | index 4a111b5..6068493 100644 | ||
77 | --- a/setup.py | ||
78 | +++ b/setup.py | ||
79 | @@ -1,17 +1,3 @@ | ||
80 | -import os | ||
81 | -import sys | ||
82 | - | ||
83 | from setuptools import setup | ||
84 | -from setuptools.config import read_configuration | ||
85 | - | ||
86 | -from setuputils import find_version | ||
87 | - | ||
88 | - | ||
89 | -def here(*paths): | ||
90 | - return os.path.join(os.path.dirname(__file__), *paths) | ||
91 | - | ||
92 | -config = read_configuration(here('setup.cfg')) | ||
93 | -config['metadata']['version'] = find_version(here('astor', '__init__.py')) | ||
94 | -config['options'].update(config['metadata']) | ||
95 | |||
96 | -setup(**config['options']) | ||
97 | +setup() | ||