summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-05-29 22:44:45 +0200
committerMichał Górny <mgorny@gentoo.org>2021-05-29 22:45:17 +0200
commitb2c5aa195cc826dffc688a413431dc713193e618 (patch)
treea03e26032ef66f3797967fec4d44ba36bd14bead /dev-python/distlib
parentdev-python/distlib: Add missing patch (diff)
downloadgentoo-b2c5aa195cc826dffc688a413431dc713193e618.tar.gz
gentoo-b2c5aa195cc826dffc688a413431dc713193e618.tar.bz2
gentoo-b2c5aa195cc826dffc688a413431dc713193e618.zip
dev-python/distlib: Enable py3.10
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/distlib')
-rw-r--r--dev-python/distlib/distlib-0.3.2.ebuild4
-rw-r--r--dev-python/distlib/files/distlib-0.3.2-py310.patch29
2 files changed, 32 insertions, 1 deletions
diff --git a/dev-python/distlib/distlib-0.3.2.ebuild b/dev-python/distlib/distlib-0.3.2.ebuild
index f63f8868e8e8..43cd8fc4d2ea 100644
--- a/dev-python/distlib/distlib-0.3.2.ebuild
+++ b/dev-python/distlib/distlib-0.3.2.ebuild
@@ -4,7 +4,7 @@
EAPI=7
DISTUTILS_USE_SETUPTOOLS=no
-PYTHON_COMPAT=( python3_{7..9} pypy3 )
+PYTHON_COMPAT=( python3_{7..10} pypy3 )
inherit distutils-r1 vcs-snapshot
@@ -38,6 +38,8 @@ src_prepare() {
# use system pypiserver instead of broken bundled one
eapply "${FILESDIR}"/distlib-0.3.2-system-pypiserver.py || die
+ # fix tests for py310
+ eapply "${FILESDIR}"/${P}-py310.patch
# doesn't work with our patched pip
sed -e '/PIP_AVAIL/s:True:False:' \
diff --git a/dev-python/distlib/files/distlib-0.3.2-py310.patch b/dev-python/distlib/files/distlib-0.3.2-py310.patch
new file mode 100644
index 000000000000..23c3dbbe0274
--- /dev/null
+++ b/dev-python/distlib/files/distlib-0.3.2-py310.patch
@@ -0,0 +1,29 @@
+From 5a9540cf58fc020b0c6a1d5c23b9b93d1abd2eb0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 29 May 2021 22:08:57 +0200
+Subject: [PATCH] Fix test_is_compatible to fix Python 3.10 support
+
+On Python 3.10, PYVER is py310 which wrongly matches the original
+'py27' <= PYVER < 'py32' condition. Replace it with explicit match
+against known Python versions in this range. This is probably
+the simplest and the most future-proof solution to the problem at hand.
+---
+ tests/test_wheel.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_wheel.py b/tests/test_wheel.py
+index 849e7c1..7c8f5ee 100644
+--- a/tests/test_wheel.py
++++ b/tests/test_wheel.py
+@@ -206,7 +206,7 @@ class WheelTestCase(DistlibTestCase):
+
+ def test_is_compatible(self):
+ fn = os.path.join(HERE, 'dummy-0.1-py27-none-any.whl')
+- if 'py27' <= PYVER < 'py32':
++ if PYVER in ('py27', 'py30', 'py31'):
+ self.assertTrue(is_compatible(fn))
+ self.assertTrue(Wheel(fn).is_compatible())
+ # use actual wheel names from PyPI.
+--
+2.31.1
+