commit: b80146770eaafa7e45d8aa8a6d92977e41dbf5a1
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Wed May 24 07:55:36 2023 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed May 24 07:55:36 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=b8014677
eclass/python-utils-r1: sync with gx86
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
eclass/python-utils-r1.eclass | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 0552c03d16..e565a8f752 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -40,7 +40,7 @@ inherit multiprocessing toolchain-funcs
# All supported Python implementations, most preferred last.
_PYTHON_ALL_IMPLS=(
pypy3
- python3_{10..11}
+ python3_{10..12}
)
readonly _PYTHON_ALL_IMPLS
@@ -80,7 +80,7 @@ _python_verify_patterns() {
local impl pattern
for pattern; do
case ${pattern} in
- -[23]|3.[89]|3.1[01])
+ -[23]|3.[89]|3.1[012])
continue
;;
esac
@@ -129,7 +129,7 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
- pypy3|python3_9|python3_1[01])
+ pypy3|python3_9|python3_1[0-2])
;;
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-9])
obsolete+=( "${i}" )
@@ -236,7 +236,7 @@ _python_impl_matches() {
[[ ${impl} == python${pattern/./_} || ${impl}
== pypy3 ]] &&
return 0
;;
- 3.8|3.1[01])
+ 3.8|3.1[0-2])
[[ ${impl} == python${pattern/./_} ]] && return 0
;;
*)
@@ -452,6 +452,8 @@ _python_export() {
PYTHON_PKG_DEP=">=dev-lang/python-3.10.9-r1:3.10";;
python3.11)
PYTHON_PKG_DEP=">=dev-lang/python-3.11.1-r1:3.11";;
+ python3.12)
+
PYTHON_PKG_DEP=">=dev-lang/python-3.12.0_beta1:3.12";;
pypy3)
PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.11-r1:0=';;
*)
@@ -1358,7 +1360,12 @@ eunittest() {
_python_check_EPYTHON
- set -- "${EPYTHON}" -m unittest_or_fail discover -v "${@}"
+ # unittest fails with "no tests" correctly since Python 3.12
+ local runner=unittest
+ if _python_impl_matches "${EPYTHON}" 3.{9..11}; then
+ runner=unittest_or_fail
+ fi
+ set -- "${EPYTHON}" -m "${runner}" discover -v "${@}"
echo "${@}" >&2
"${@}" || die -n "Tests failed with ${EPYTHON}"