diff --git a/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass b/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass index 040d374bbf..52e9e061d6 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/python-utils-r1.eclass +++ b/sdk_container/src/third_party/portage-stable/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 ;; *) @@ -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}"