[PATCH 1/3] python-utils-r1.eclass: Require old impl cleanup for EAPI 9

Michał Górny <[email protected]> Tue, 9 Jun 2026 20:11:08 +0200
Newsgroups gmane.linux.gentoo.devel
Message-ID <[email protected]>
Signed-off-by: Michał Górny <[email protected]>
---
 eclass/python-utils-r1.eclass | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 3dfd1400d1671..bfedfa7b84afc 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -139,7 +139,14 @@ _python_set_impls() {
 			case ${i} in
 				python3_1[2-5]|python3_1[4-5]t)
 					;;
+				# implementations deprecated prior to EAPI 9 are fatal
 				jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|pypy3_11|python2_[5-7]|python3_[1-9]|python3_1[01]|python3_13t)
+					[[ ${EAPI} != [78] ]] &&
+						die "Please remove old implementations from PYTHON_COMPAT for EAPI ${EAPI}"
+					;&
+				# implementations deprecated after EAPI 9 are non-fatal
+				# (none yet, hence placeholder)
+				python3_x)
 					obsolete+=( "${i}" )
 					;;
 				*)
@@ -230,10 +237,18 @@ _python_impl_matches() {
 				fi
 				return 0
 				;;
-			3.[89]|3.1[0-5])
+			3.[89]|3.10)
+				[[ ${EAPI} != [78] ]] &&
+					die "Please remove old implementations from ${FUNCNAME[1]} in EAPI ${EAPI}"
+				;&
+			3.1[1-5])
 				[[ ${impl%t} == python${pattern/./_} || ${impl} == pypy${pattern/./_} ]] &&
 					return 0
 				;;
+			jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9]|python3_10)
+				[[ ${EAPI} != [78] ]] &&
+					die "Please remove old implementations from ${FUNCNAME[1]} in EAPI ${EAPI}"
+				;;
 			*)
 				# unify value style to allow lax matching
 				[[ ${impl} == ${pattern/./_} ]] && return 0