1 |
commit: aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87 |
2 |
Author: John Helmert III <jchelmert3 <AT> posteo <DOT> net> |
3 |
AuthorDate: Mon Jul 27 20:22:44 2020 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 5 04:41:34 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa7b6caf |
7 |
|
8 |
dev-python/configobj: Various fixes |
9 |
|
10 |
Switch SRC_URI to Github release tarball, add patch to fix tests on arm, |
11 |
EAPI bump, add DISTUTILS_USE_SETUPTOOLS=no like the eclass suggests. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/732092 |
14 |
Package-Manager: Portage-3.0.1, Repoman-2.3.23 |
15 |
Signed-off-by: John Helmert III <jchelmert3 <AT> posteo.net> |
16 |
Closes: https://github.com/gentoo/gentoo/pull/16865 |
17 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
18 |
|
19 |
dev-python/configobj/Manifest | 1 + |
20 |
dev-python/configobj/configobj-5.0.6-r1.ebuild | 25 ++++++++++ |
21 |
.../files/configobj-5.0.6-fix-py2-tests.patch | 55 ++++++++++++++++++++++ |
22 |
3 files changed, 81 insertions(+) |
23 |
|
24 |
diff --git a/dev-python/configobj/Manifest b/dev-python/configobj/Manifest |
25 |
index 09a7a68b348..a606bd2e893 100644 |
26 |
--- a/dev-python/configobj/Manifest |
27 |
+++ b/dev-python/configobj/Manifest |
28 |
@@ -1 +1,2 @@ |
29 |
+DIST configobj-5.0.6.gh.tar.gz 143664 BLAKE2B b554d0aec903aecb55387a0164cd6f8d442e9fc1ab231ce7f7123e7a5041e07a86f5f7bf70492ca93fcdc1bd3caa5b855c427f060842e3b4a7524afbcc417a76 SHA512 326eb86e362f281ebf07abcb1cf7616abb270c482eafe842371cda8708245ca5e8262f1644b7164664ecc10e9004ed061c9de18cd233a657d4697dbc3ba3c59d |
30 |
DIST configobj-5.0.6.tar.gz 33248 BLAKE2B b58a22fdf247f1c3022108e24abb4de55620ce75f6aeb5f269f008a5668e07b8c1d0c49e4059d7f4c4c361d269ead39c3784377635c7718f92c2381e69c56cb5 SHA512 f253fdd0bc3fcd37f56c9ceb28f5c8c739b0861e099b07a3929645907c97b2261f0529850a95c1a42507846f72d88a0992fcd1e1d6fa8654dc713d120f769963 |
31 |
|
32 |
diff --git a/dev-python/configobj/configobj-5.0.6-r1.ebuild b/dev-python/configobj/configobj-5.0.6-r1.ebuild |
33 |
new file mode 100644 |
34 |
index 00000000000..469eee85be8 |
35 |
--- /dev/null |
36 |
+++ b/dev-python/configobj/configobj-5.0.6-r1.ebuild |
37 |
@@ -0,0 +1,25 @@ |
38 |
+# Copyright 1999-2020 Gentoo Authors |
39 |
+# Distributed under the terms of the GNU General Public License v2 |
40 |
+ |
41 |
+EAPI=7 |
42 |
+ |
43 |
+PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} ) |
44 |
+DISTUTILS_USE_SETUPTOOLS=no |
45 |
+ |
46 |
+inherit distutils-r1 |
47 |
+ |
48 |
+DESCRIPTION="Simple config file reader and writer" |
49 |
+HOMEPAGE="http://www.voidspace.org.uk/python/configobj.html https://pypi.org/project/configobj/" |
50 |
+SRC_URI="https://github.com/DiffSK/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" |
51 |
+ |
52 |
+LICENSE="BSD" |
53 |
+SLOT="0" |
54 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
55 |
+ |
56 |
+RDEPEND="dev-python/six[${PYTHON_USEDEP}]" |
57 |
+ |
58 |
+PATCHES=( "${FILESDIR}/${P}-fix-py2-tests.patch" ) |
59 |
+ |
60 |
+python_test() { |
61 |
+ "${EPYTHON}" validate.py -v || die "Tests fail with ${EPYTHON}" |
62 |
+} |
63 |
|
64 |
diff --git a/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch b/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch |
65 |
new file mode 100644 |
66 |
index 00000000000..5ac64a256cb |
67 |
--- /dev/null |
68 |
+++ b/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch |
69 |
@@ -0,0 +1,55 @@ |
70 |
+Upstream: https://github.com/DiffSK/configobj/commit/e2731538d1a37a5b67a6e518848be6a8988043ae |
71 |
+ |
72 |
+diff --git a/tests/test_validate.py b/tests/test_validate.py |
73 |
+index bffb0dc..4eed7e9 100644 |
74 |
+--- a/tests/test_validate.py |
75 |
++++ b/tests/test_validate.py |
76 |
+@@ -161,3 +161,26 @@ class TestBasic(object): |
77 |
+ 'test3': 3, |
78 |
+ 'test4': 6.0 |
79 |
+ }}} |
80 |
++ |
81 |
++ |
82 |
++class TestDottedQuadToNum(object): |
83 |
++ |
84 |
++ def test_stripped(self): |
85 |
++ assert dottedQuadToNum('192.0.2.0') == 3221225984 |
86 |
++ assert dottedQuadToNum('192.0.2.1 ') == 3221225985 |
87 |
++ assert dottedQuadToNum(' 192.0.2.2') == 3221225986 |
88 |
++ assert dottedQuadToNum('\t\t192.0.2.3\n') == 3221225987 |
89 |
++ with pytest.raises(ValueError) as excinfo: |
90 |
++ dottedQuadToNum('192. 0. 2. 4') |
91 |
++ assert str(excinfo.value) == 'Not a good dotted-quad IP: 192. 0. 2. 4' |
92 |
++ |
93 |
++ def test_boundaries(self): |
94 |
++ assert dottedQuadToNum('0.0.0.0') == 0 |
95 |
++ assert dottedQuadToNum('255.255.255.255') == 4294967295 |
96 |
++ with pytest.raises(ValueError) as excinfo: |
97 |
++ dottedQuadToNum('255.255.255.256') |
98 |
++ assert str(excinfo.value) == ( |
99 |
++ 'Not a good dotted-quad IP: 255.255.255.256') |
100 |
++ with pytest.raises(ValueError) as excinfo: |
101 |
++ dottedQuadToNum('-1') |
102 |
++ assert str(excinfo.value) == 'Not a good dotted-quad IP: -1' |
103 |
+diff --git a/validate.py b/validate.py |
104 |
+index b7a964c..9d8c94d 100644 |
105 |
+--- a/validate.py |
106 |
++++ b/validate.py |
107 |
+@@ -277,17 +277,8 @@ def dottedQuadToNum(ip): |
108 |
+ |
109 |
+ >>> int(dottedQuadToNum('1 ')) |
110 |
+ 1 |
111 |
+- >>> int(dottedQuadToNum(' 1.2')) |
112 |
+- 16777218 |
113 |
+- >>> int(dottedQuadToNum(' 1.2.3 ')) |
114 |
+- 16908291 |
115 |
+ >>> int(dottedQuadToNum('1.2.3.4')) |
116 |
+ 16909060 |
117 |
+- >>> dottedQuadToNum('255.255.255.255') |
118 |
+- 4294967295 |
119 |
+- >>> dottedQuadToNum('255.255.255.256') |
120 |
+- Traceback (most recent call last): |
121 |
+- ValueError: Not a good dotted-quad IP: 255.255.255.256 |
122 |
+ """ |
123 |
+ |
124 |
+ # import here to avoid it when ip_addr values are not used |