mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-27 16:41:11 +02:00
eclass/python-utils-r1: Sync with Gentoo
It's from Gentoo commit 0b140f9228e2ed7e76124986d2911776922cd342.
This commit is contained in:
parent
3be359e77f
commit
7f95dbd880
@ -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
|
||||
;;
|
||||
*)
|
||||
@ -441,11 +441,13 @@ _python_export() {
|
||||
local d
|
||||
case ${impl} in
|
||||
python3.10)
|
||||
PYTHON_PKG_DEP=">=dev-lang/python-3.10.9-r1:3.10";;
|
||||
PYTHON_PKG_DEP=">=dev-lang/python-3.10.11:3.10";;
|
||||
python3.11)
|
||||
PYTHON_PKG_DEP=">=dev-lang/python-3.11.1-r1:3.11";;
|
||||
PYTHON_PKG_DEP=">=dev-lang/python-3.11.3: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=';;
|
||||
PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.11_p1:0=';;
|
||||
*)
|
||||
die "Invalid implementation: ${impl}"
|
||||
esac
|
||||
@ -1342,7 +1344,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}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user