Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/distlib/files/, dev-python/distlib/
Date: Sat, 29 May 2021 20:45:25
Message-Id: 1622321117.b2c5aa195cc826dffc688a413431dc713193e618.mgorny@gentoo
1 commit: b2c5aa195cc826dffc688a413431dc713193e618
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 29 20:44:45 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat May 29 20:45:17 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2c5aa19
7
8 dev-python/distlib: Enable py3.10
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/distlib/distlib-0.3.2.ebuild | 4 ++-
13 dev-python/distlib/files/distlib-0.3.2-py310.patch | 29 ++++++++++++++++++++++
14 2 files changed, 32 insertions(+), 1 deletion(-)
15
16 diff --git a/dev-python/distlib/distlib-0.3.2.ebuild b/dev-python/distlib/distlib-0.3.2.ebuild
17 index f63f8868e8e..43cd8fc4d2e 100644
18 --- a/dev-python/distlib/distlib-0.3.2.ebuild
19 +++ b/dev-python/distlib/distlib-0.3.2.ebuild
20 @@ -4,7 +4,7 @@
21 EAPI=7
22
23 DISTUTILS_USE_SETUPTOOLS=no
24 -PYTHON_COMPAT=( python3_{7..9} pypy3 )
25 +PYTHON_COMPAT=( python3_{7..10} pypy3 )
26
27 inherit distutils-r1 vcs-snapshot
28
29 @@ -38,6 +38,8 @@ src_prepare() {
30
31 # use system pypiserver instead of broken bundled one
32 eapply "${FILESDIR}"/distlib-0.3.2-system-pypiserver.py || die
33 + # fix tests for py310
34 + eapply "${FILESDIR}"/${P}-py310.patch
35
36 # doesn't work with our patched pip
37 sed -e '/PIP_AVAIL/s:True:False:' \
38
39 diff --git a/dev-python/distlib/files/distlib-0.3.2-py310.patch b/dev-python/distlib/files/distlib-0.3.2-py310.patch
40 new file mode 100644
41 index 00000000000..23c3dbbe027
42 --- /dev/null
43 +++ b/dev-python/distlib/files/distlib-0.3.2-py310.patch
44 @@ -0,0 +1,29 @@
45 +From 5a9540cf58fc020b0c6a1d5c23b9b93d1abd2eb0 Mon Sep 17 00:00:00 2001
46 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
47 +Date: Sat, 29 May 2021 22:08:57 +0200
48 +Subject: [PATCH] Fix test_is_compatible to fix Python 3.10 support
49 +
50 +On Python 3.10, PYVER is py310 which wrongly matches the original
51 +'py27' <= PYVER < 'py32' condition. Replace it with explicit match
52 +against known Python versions in this range. This is probably
53 +the simplest and the most future-proof solution to the problem at hand.
54 +---
55 + tests/test_wheel.py | 2 +-
56 + 1 file changed, 1 insertion(+), 1 deletion(-)
57 +
58 +diff --git a/tests/test_wheel.py b/tests/test_wheel.py
59 +index 849e7c1..7c8f5ee 100644
60 +--- a/tests/test_wheel.py
61 ++++ b/tests/test_wheel.py
62 +@@ -206,7 +206,7 @@ class WheelTestCase(DistlibTestCase):
63 +
64 + def test_is_compatible(self):
65 + fn = os.path.join(HERE, 'dummy-0.1-py27-none-any.whl')
66 +- if 'py27' <= PYVER < 'py32':
67 ++ if PYVER in ('py27', 'py30', 'py31'):
68 + self.assertTrue(is_compatible(fn))
69 + self.assertTrue(Wheel(fn).is_compatible())
70 + # use actual wheel names from PyPI.
71 +--
72 +2.31.1
73 +