commit:     81573375223269fcb469cb2dcce59fbe753f3d5e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  8 07:50:11 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jul  8 08:26:01 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81573375

dev-python/distlib: Bump to 0.3.1, fix tests

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/distlib/Manifest                        |  1 +
 dev-python/distlib/distlib-0.3.1.ebuild            | 51 ++++++++++++++++++++++
 .../files/distlib-0.3.1-system-pypiserver.py       | 37 ++++++++++++++++
 3 files changed, 89 insertions(+)

diff --git a/dev-python/distlib/Manifest b/dev-python/distlib/Manifest
index 4bbb3b2204a..2183bfda011 100644
--- a/dev-python/distlib/Manifest
+++ b/dev-python/distlib/Manifest
@@ -1 +1,2 @@
 DIST distlib-0.3.0.tar.bz2 848089 BLAKE2B 
70f88b570229e2ab4c95bd8da0375aba189f66dec8defcf8eedf1be6924d93bd20b54c68e5fba867a6c68a31d4ef926ee2dc18ccb0391278680f30a62d0cd251
 SHA512 
01b0e7d59736414a241efdf883e4ee63eafe9614ce3b4147781a5750d25d6383543146c5277e3e0d3e11ce03693afd0331c6e3416776a6f84de7a4d9dadf3de4
+DIST distlib-0.3.1.tar.bz2 1068500 BLAKE2B 
52135869242f71cc6d6887da6d9e20ffc6b46c84d8146393961062d92d8c0bd68e1309277f64fdec0319ff3c503b1caaba3d5378f5c081dca79573c8d9c2e6f2
 SHA512 
f259299176c45be7024b80759015a2fad120ffdde55b6abea0f7fb0335cee90809b5daedcb88abdfb68fd496284b2e478df622004b3750327bfc86807581116c

diff --git a/dev-python/distlib/distlib-0.3.1.ebuild 
b/dev-python/distlib/distlib-0.3.1.ebuild
new file mode 100644
index 00000000000..349667d657a
--- /dev/null
+++ b/dev-python/distlib/distlib-0.3.1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=no
+PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 )
+
+inherit distutils-r1 vcs-snapshot
+
+DESCRIPTION="Low-level components of distutils2/packaging"
+HOMEPAGE="https://pypi.org/project/distlib/
+       https://bitbucket.org/pypa/distlib/";
+# pypi has zip only :-(
+SRC_URI="
+       https://bitbucket.org/pypa/distlib/get/${PV}.tar.bz2 -> ${P}.tar.bz2"
+
+LICENSE="PSF-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+# openpyxl installs invalid metadata that breaks distlib
+BDEPEND="
+       test? (
+               dev-python/pypiserver[${PYTHON_USEDEP}]
+               !!<dev-python/openpyxl-3.0.3[${PYTHON_USEDEP}]
+       )"
+
+src_prepare() {
+       # make sure they're not used
+       rm -r tests/unittest2 || die
+       rm tests/pypi-server-standalone.py || die
+
+       # use system pypiserver instead of broken bundled one
+       eapply "${FILESDIR}"/distlib-0.3.1-system-pypiserver.py || die
+
+       # doesn't work with our patched pip
+       sed -e '/PIP_AVAIL/s:True:False:' \
+               -i tests/test_wheel.py || die
+
+       distutils-r1_src_prepare
+}
+
+python_test() {
+       local -x SKIP_ONLINE=1
+       local -x PYTHONHASHSEED=0
+       "${EPYTHON}" tests/test_all.py -v ||
+               die "Tests failed with ${EPYTHON}"
+}

diff --git a/dev-python/distlib/files/distlib-0.3.1-system-pypiserver.py 
b/dev-python/distlib/files/distlib-0.3.1-system-pypiserver.py
new file mode 100644
index 00000000000..44a7583968b
--- /dev/null
+++ b/dev-python/distlib/files/distlib-0.3.1-system-pypiserver.py
@@ -0,0 +1,37 @@
+From 30b1b46cb02cef9cb0317a3500fd1497e594a797 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgo...@gentoo.org>
+Date: Wed, 8 Jul 2020 09:24:42 +0200
+Subject: [PATCH] Use system pypiserver
+
+---
+ tests/test_index.py | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/tests/test_index.py b/tests/test_index.py
+index bc24367..623b027 100644
+--- a/tests/test_index.py
++++ b/tests/test_index.py
+@@ -52,11 +52,6 @@ class PackageIndexTestCase(unittest.TestCase):
+     def setUpClass(cls):
+         if cls.run_test_server:
+             cls.server = None
+-            server_script = os.path.join(HERE, 'pypi-server-standalone.py')
+-            if not os.path.exists(server_script):
+-                logger.debug('test server not available - some tests '
+-                             'will be skipped.')
+-                return
+             pwdfn = os.path.join(HERE, 'passwords')
+             if not os.path.exists(pwdfn):   # pragma: no cover
+                 with open(pwdfn, 'w') as f:
+@@ -65,7 +60,7 @@ class PackageIndexTestCase(unittest.TestCase):
+             if not os.path.isdir(pkgdir):   # pragma: no cover
+                 os.mkdir(pkgdir)
+             cls.sink = sink = open(os.devnull, 'w')
+-            cmd = [sys.executable, 'pypi-server-standalone.py',
++            cmd = [sys.executable, '-m', 'pypiserver',
+                    '-P', 'passwords', 'packages']
+             cls.server = subprocess.Popen(cmd, stdout=sink, stderr=sink,
+                                           cwd=HERE)
+-- 
+2.27.0
+

Reply via email to