diff options
author | John Helmert III <jchelmert3@posteo.net> | 2020-07-27 15:22:44 -0500 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2020-08-05 04:41:34 +0000 |
commit | aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87 (patch) | |
tree | 7149366a336888064404466dbb66c4c9ce11dd40 /dev-python | |
parent | dev-libs/jsoncpp: Stabilize 1.9.3 arm, #734538 (diff) | |
download | gentoo-aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87.tar.gz gentoo-aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87.tar.bz2 gentoo-aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87.zip |
dev-python/configobj: Various fixes
Switch SRC_URI to Github release tarball, add patch to fix tests on arm,
EAPI bump, add DISTUTILS_USE_SETUPTOOLS=no like the eclass suggests.
Closes: https://bugs.gentoo.org/732092
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: John Helmert III <jchelmert3@posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/16865
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/configobj/Manifest | 1 | ||||
-rw-r--r-- | dev-python/configobj/configobj-5.0.6-r1.ebuild | 25 | ||||
-rw-r--r-- | dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch | 55 |
3 files changed, 81 insertions, 0 deletions
diff --git a/dev-python/configobj/Manifest b/dev-python/configobj/Manifest index 09a7a68b3487..a606bd2e893c 100644 --- a/dev-python/configobj/Manifest +++ b/dev-python/configobj/Manifest @@ -1 +1,2 @@ +DIST configobj-5.0.6.gh.tar.gz 143664 BLAKE2B b554d0aec903aecb55387a0164cd6f8d442e9fc1ab231ce7f7123e7a5041e07a86f5f7bf70492ca93fcdc1bd3caa5b855c427f060842e3b4a7524afbcc417a76 SHA512 326eb86e362f281ebf07abcb1cf7616abb270c482eafe842371cda8708245ca5e8262f1644b7164664ecc10e9004ed061c9de18cd233a657d4697dbc3ba3c59d DIST configobj-5.0.6.tar.gz 33248 BLAKE2B b58a22fdf247f1c3022108e24abb4de55620ce75f6aeb5f269f008a5668e07b8c1d0c49e4059d7f4c4c361d269ead39c3784377635c7718f92c2381e69c56cb5 SHA512 f253fdd0bc3fcd37f56c9ceb28f5c8c739b0861e099b07a3929645907c97b2261f0529850a95c1a42507846f72d88a0992fcd1e1d6fa8654dc713d120f769963 diff --git a/dev-python/configobj/configobj-5.0.6-r1.ebuild b/dev-python/configobj/configobj-5.0.6-r1.ebuild new file mode 100644 index 000000000000..469eee85be81 --- /dev/null +++ b/dev-python/configobj/configobj-5.0.6-r1.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} ) +DISTUTILS_USE_SETUPTOOLS=no + +inherit distutils-r1 + +DESCRIPTION="Simple config file reader and writer" +HOMEPAGE="http://www.voidspace.org.uk/python/configobj.html https://pypi.org/project/configobj/" +SRC_URI="https://github.com/DiffSK/${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="BSD" +SLOT="0" +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" + +RDEPEND="dev-python/six[${PYTHON_USEDEP}]" + +PATCHES=( "${FILESDIR}/${P}-fix-py2-tests.patch" ) + +python_test() { + "${EPYTHON}" validate.py -v || die "Tests fail with ${EPYTHON}" +} 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 new file mode 100644 index 000000000000..5ac64a256cb6 --- /dev/null +++ b/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch @@ -0,0 +1,55 @@ +Upstream: https://github.com/DiffSK/configobj/commit/e2731538d1a37a5b67a6e518848be6a8988043ae + +diff --git a/tests/test_validate.py b/tests/test_validate.py +index bffb0dc..4eed7e9 100644 +--- a/tests/test_validate.py ++++ b/tests/test_validate.py +@@ -161,3 +161,26 @@ class TestBasic(object): + 'test3': 3, + 'test4': 6.0 + }}} ++ ++ ++class TestDottedQuadToNum(object): ++ ++ def test_stripped(self): ++ assert dottedQuadToNum('192.0.2.0') == 3221225984 ++ assert dottedQuadToNum('192.0.2.1 ') == 3221225985 ++ assert dottedQuadToNum(' 192.0.2.2') == 3221225986 ++ assert dottedQuadToNum('\t\t192.0.2.3\n') == 3221225987 ++ with pytest.raises(ValueError) as excinfo: ++ dottedQuadToNum('192. 0. 2. 4') ++ assert str(excinfo.value) == 'Not a good dotted-quad IP: 192. 0. 2. 4' ++ ++ def test_boundaries(self): ++ assert dottedQuadToNum('0.0.0.0') == 0 ++ assert dottedQuadToNum('255.255.255.255') == 4294967295 ++ with pytest.raises(ValueError) as excinfo: ++ dottedQuadToNum('255.255.255.256') ++ assert str(excinfo.value) == ( ++ 'Not a good dotted-quad IP: 255.255.255.256') ++ with pytest.raises(ValueError) as excinfo: ++ dottedQuadToNum('-1') ++ assert str(excinfo.value) == 'Not a good dotted-quad IP: -1' +diff --git a/validate.py b/validate.py +index b7a964c..9d8c94d 100644 +--- a/validate.py ++++ b/validate.py +@@ -277,17 +277,8 @@ def dottedQuadToNum(ip): + + >>> int(dottedQuadToNum('1 ')) + 1 +- >>> int(dottedQuadToNum(' 1.2')) +- 16777218 +- >>> int(dottedQuadToNum(' 1.2.3 ')) +- 16908291 + >>> int(dottedQuadToNum('1.2.3.4')) + 16909060 +- >>> dottedQuadToNum('255.255.255.255') +- 4294967295 +- >>> dottedQuadToNum('255.255.255.256') +- Traceback (most recent call last): +- ValueError: Not a good dotted-quad IP: 255.255.255.256 + """ + + # import here to avoid it when ip_addr values are not used |