commit:     ee468eec11953a67f877bc7e15079f9dcdc7ddaa
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 15:51:25 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 17 09:44:22 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee468eec

python-utils-r1.eclass: Loosen minimal Python versions

Loosen minimal Python versions to accept any version in a given slot.
Lower bounds are cumbersome to maintain and cause problems when
upgrading outdated systems, particularly when sys-libs/glibc
is involved.

We could technically apply some hack to make any-r1 dependency checks
to conditionally ignore minimal versions but that sounds like
unnecessary complexity.  In the end, minimum versions were primarily
enforced to make sure users got the latest bugfixes but that doesn't
seem strictly necessary.

Closes: https://bugs.gentoo.org/910288
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/31796
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/python-any-r1.eclass   |  6 +++---
 eclass/python-r1.eclass       |  2 +-
 eclass/python-utils-r1.eclass | 12 +++++-------
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index d7d44a87f516..4e2e12e228ad 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: python-any-r1.eclass
@@ -176,7 +176,7 @@ _python_any_set_globals() {
                _python_export "${i}" PYTHON_PKG_DEP
 
                # note: need to strip '=' slot operator for || deps
-               deps="${PYTHON_PKG_DEP/:0=/:0} ${deps}"
+               deps="${PYTHON_PKG_DEP/:=} ${deps}"
        done
        deps="|| ( ${deps})"
 
@@ -259,7 +259,7 @@ python_gen_any_dep() {
                local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
                
i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}}
                # note: need to strip '=' slot operator for || deps
-               out="( ${PYTHON_PKG_DEP%=} ${i_depstr} ) ${out}"
+               out="( ${PYTHON_PKG_DEP%:=} ${i_depstr} ) ${out}"
        done
        echo "|| ( ${out})"
 }

diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 4758defe6493..b816e3b6f855 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -522,7 +522,7 @@ python_gen_any_dep() {
                        local 
i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
                        
i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}}
                        # note: need to strip '=' slot operator for || deps
-                       out="( ${PYTHON_PKG_DEP/:0=/:0} ${i_depstr} ) ${out}"
+                       out="( ${PYTHON_PKG_DEP/:=} ${i_depstr} ) ${out}"
                fi
        done
        echo "|| ( ${out})"

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index a395538be39c..a883135eaa41 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -446,14 +446,12 @@ _python_export() {
                        PYTHON_PKG_DEP)
                                local d
                                case ${impl} in
-                                       python3.10)
-                                               
PYTHON_PKG_DEP=">=dev-lang/python-3.10.12:3.10";;
-                                       python3.11)
-                                               
PYTHON_PKG_DEP=">=dev-lang/python-3.11.4:3.11";;
-                                       python3.12)
-                                               
PYTHON_PKG_DEP=">=dev-lang/python-3.12.0_beta3:3.12";;
+                                       python*)
+                                               
PYTHON_PKG_DEP="dev-lang/python:${impl#python}"
+                                               ;;
                                        pypy3)
-                                               
PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.12:0=';;
+                                               
PYTHON_PKG_DEP="dev-python/${impl}:="
+                                               ;;
                                        *)
                                                die "Invalid implementation: 
${impl}"
                                esac

Reply via email to