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: eclass/, eclass/tests/
Date: Mon, 09 May 2022 20:33:41
Message-Id: 1652128305.53fc3b443284eb94b3bfb4266ee0efb890441dbd.mgorny@gentoo
1 commit: 53fc3b443284eb94b3bfb4266ee0efb890441dbd
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 8 10:15:35 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon May 9 20:31:45 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53fc3b44
7
8 python-utils-r1.eclass: Add support for python3.11
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 eclass/python-utils-r1.eclass | 10 ++++++----
13 eclass/tests/python-utils-r1.sh | 14 ++++++++++++++
14 2 files changed, 20 insertions(+), 4 deletions(-)
15
16 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
17 index 7b1bd012a37e..2b22b0539ecb 100644
18 --- a/eclass/python-utils-r1.eclass
19 +++ b/eclass/python-utils-r1.eclass
20 @@ -43,7 +43,7 @@ inherit multiprocessing toolchain-funcs
21 # All supported Python implementations, most preferred last.
22 _PYTHON_ALL_IMPLS=(
23 pypy3
24 - python3_{8..10}
25 + python3_{8..11}
26 )
27 readonly _PYTHON_ALL_IMPLS
28
29 @@ -83,7 +83,7 @@ _python_verify_patterns() {
30 local impl pattern
31 for pattern; do
32 case ${pattern} in
33 - -[23]|3.[89]|3.10)
34 + -[23]|3.[89]|3.1[01])
35 continue
36 ;;
37 esac
38 @@ -132,7 +132,7 @@ _python_set_impls() {
39 # please keep them in sync with _PYTHON_ALL_IMPLS
40 # and _PYTHON_HISTORICAL_IMPLS
41 case ${i} in
42 - pypy3|python2_7|python3_[89]|python3_10)
43 + pypy3|python2_7|python3_[89]|python3_1[01])
44 ;;
45 jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7])
46 obsolete+=( "${i}" )
47 @@ -245,7 +245,7 @@ _python_impl_matches() {
48 [[ ${impl} == python${pattern/./_} || ${impl} == pypy3 ]] &&
49 return 0
50 ;;
51 - 3.8|3.10)
52 + 3.8|3.1[01])
53 [[ ${impl} == python${pattern/./_} ]] && return 0
54 ;;
55 *)
56 @@ -461,6 +461,8 @@ _python_export() {
57 PYTHON_PKG_DEP=">=dev-lang/python-3.9.9-r1:3.9";;
58 python3.10)
59 PYTHON_PKG_DEP=">=dev-lang/python-3.10.0_p1-r1:3.10";;
60 + python3.11)
61 + PYTHON_PKG_DEP=">=dev-lang/python-3.11.0_beta1:3.11";;
62 python*)
63 PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
64 pypy)
65
66 diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
67 index 9c41798c4727..e0fc0aab3c03 100755
68 --- a/eclass/tests/python-utils-r1.sh
69 +++ b/eclass/tests/python-utils-r1.sh
70 @@ -147,6 +147,20 @@ fi
71 test_var PYTHON_PKG_DEP python3_10 '*dev-lang/python*:3.10'
72 test_var PYTHON_SCRIPTDIR python3_10 /usr/lib/python-exec/python3.10
73
74 +test_var EPYTHON python3_11 python3.11
75 +test_var PYTHON python3_11 /usr/bin/python3.11
76 +if [[ -x /usr/bin/python3.11 ]]; then
77 + abiflags=$(/usr/bin/python3.11 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
78 + test_var PYTHON_SITEDIR python3_11 "/usr/lib/python3.11/site-packages"
79 + test_var PYTHON_INCLUDEDIR python3_11 "/usr/include/python3.11${abiflags}"
80 + test_var PYTHON_LIBPATH python3_11 "/usr/lib*/libpython3.11${abiflags}$(get_libname)"
81 + test_var PYTHON_CONFIG python3_11 "/usr/bin/python3.11${abiflags}-config"
82 + test_var PYTHON_CFLAGS python3_11 "*-I/usr/include/python3.11*"
83 + test_var PYTHON_LIBS python3_11 "*-lpython3.11*"
84 +fi
85 +test_var PYTHON_PKG_DEP python3_11 '*dev-lang/python*:3.11'
86 +test_var PYTHON_SCRIPTDIR python3_11 /usr/lib/python-exec/python3.11
87 +
88 test_var EPYTHON pypy3 pypy3
89 test_var PYTHON pypy3 /usr/bin/pypy3
90 if [[ -x /usr/bin/pypy3 ]]; then