dev-python/distlib: Enable py3.10

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2021-05-29 22:45:17 +02:00
parent 9b464b677f
commit b2c5aa195c
2 changed files with 32 additions and 1 deletions
+3 -1
View File
@@ -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:' \
@@ -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