Gentoo Archives: gentoo-dev

From: David Seifert <soap@g.o>
To: gentoo-dev@l.g.o
Cc: David Seifert <soap@g.o>
Subject: [gentoo-dev] [PATCH 27/41] python-utils-r1.eclass: drop EAPI 6 support
Date: Sun, 25 Dec 2022 22:23:00
Message-Id: 20221225221552.8023-27-soap@gentoo.org
In Reply to: [gentoo-dev] [PATCH 01/41] ada.eclass: drop EAPI 6 support by David Seifert
1 Signed-off-by: David Seifert <soap@g.o>
2 ---
3 eclass/python-utils-r1.eclass | 45 +++++++++++------------------------
4 1 file changed, 14 insertions(+), 31 deletions(-)
5
6 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
7 index d7b3df6105a..568b2dbdfa4 100644
8 --- a/eclass/python-utils-r1.eclass
9 +++ b/eclass/python-utils-r1.eclass
10 @@ -7,7 +7,7 @@
11 # @AUTHOR:
12 # Author: Michał Górny <mgorny@g.o>
13 # Based on work of: Krzysztof Pawlik <nelchael@g.o>
14 -# @SUPPORTED_EAPIS: 6 7 8
15 +# @SUPPORTED_EAPIS: 7 8
16 # @BLURB: Utility functions for packages with Python parts.
17 # @DESCRIPTION:
18 # A utility eclass providing functions to query Python implementations,
19 @@ -22,20 +22,16 @@
20 # NOTE: When dropping support for EAPIs here, we need to update
21 # metadata/install-qa-check.d/60python-pyc
22 # See bug #704286, bug #781878
23 -case "${EAPI:-0}" in
24 - [0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
25 - [6-8]) ;;
26 - *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
27 -esac
28
29 -if [[ ${_PYTHON_ECLASS_INHERITED} ]]; then
30 - die 'python-r1 suite eclasses can not be used with python.eclass.'
31 -fi
32 +case ${EAPI} in
33 + 7|8) ;;
34 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
35 +esac
36
37 -if [[ ! ${_PYTHON_UTILS_R1} ]]; then
38 +if [[ ! ${_PYTHON_UTILS_R1_ECLASS} ]]; then
39 +_PYTHON_UTILS_R1_ECLASS=1
40
41 -[[ ${EAPI} == [67] ]] && inherit eapi8-dosym
42 -[[ ${EAPI} == 6 ]] && inherit eqawarn
43 +[[ ${EAPI} == 7 ]] && inherit eapi8-dosym
44 inherit multiprocessing toolchain-funcs
45
46 # @ECLASS_VARIABLE: _PYTHON_ALL_IMPLS
47 @@ -218,7 +214,7 @@ _python_impl_matches() {
48 for pattern; do
49 case ${pattern} in
50 -2|python2*|pypy)
51 - if [[ ${EAPI} != [67] ]]; then
52 + if [[ ${EAPI} != 7 ]]; then
53 eerror
54 eerror "Python 2 is no longer supported in Gentoo, please remove Python 2"
55 eerror "${FUNCNAME[1]} calls."
56 @@ -227,7 +223,7 @@ _python_impl_matches() {
57 ;;
58 -3)
59 # NB: "python3*" is fine, as "not pypy3"
60 - if [[ ${EAPI} != [67] ]]; then
61 + if [[ ${EAPI} != 7 ]]; then
62 eerror
63 eerror "Python 2 is no longer supported in Gentoo, please remove Python 2"
64 eerror "${FUNCNAME[1]} calls."
65 @@ -724,7 +720,7 @@ python_newexe() {
66
67 # install the wrapper
68 local dosym=dosym
69 - [[ ${EAPI} == [67] ]] && dosym=dosym8
70 + [[ ${EAPI} == 7 ]] && dosym=dosym8
71 "${dosym}" -r /usr/lib/python-exec/python-exec2 "${wrapd}/${newfn}"
72
73 # don't use this at home, just call python_doscript() instead
74 @@ -1368,15 +1364,13 @@ _python_run_check_deps() {
75 debug-print-function ${FUNCNAME} "${@}"
76
77 local impl=${1}
78 - local hasv_args=( -b )
79 - [[ ${EAPI} == 6 ]] && hasv_args=( --host-root )
80
81 einfo "Checking whether ${impl} is suitable ..."
82
83 local PYTHON_PKG_DEP
84 _python_export "${impl}" PYTHON_PKG_DEP
85 ebegin " ${PYTHON_PKG_DEP}"
86 - has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}"
87 + has_version -b "${PYTHON_PKG_DEP}"
88 eend ${?} || return 1
89 declare -f python_check_deps >/dev/null || return 0
90
91 @@ -1393,10 +1387,8 @@ _python_run_check_deps() {
92 # A convenience wrapper for has_version() with verbose output and better
93 # defaults for use in python_check_deps().
94 #
95 -# The wrapper accepts EAPI 7+-style -b/-d/-r options to indicate
96 -# the root to perform the lookup on. Unlike has_version, the default
97 -# is -b. In EAPI 6, -b and -d are translated to --host-root
98 -# for compatibility.
99 +# The wrapper accepts -b/-d/-r options to indicate the root to perform
100 +# the lookup on. Unlike has_version, the default is -b.
101 #
102 # The wrapper accepts multiple package specifications. For the check
103 # to succeed, *all* specified atoms must match.
104 @@ -1411,14 +1403,6 @@ python_has_version() {
105 ;;
106 esac
107
108 - if [[ ${EAPI} == 6 ]]; then
109 - if [[ ${root_arg} == -r ]]; then
110 - root_arg=()
111 - else
112 - root_arg=( --host-root )
113 - fi
114 - fi
115 -
116 local pkg
117 for pkg; do
118 ebegin " ${pkg}"
119 @@ -1429,5 +1413,4 @@ python_has_version() {
120 return 0
121 }
122
123 -_PYTHON_UTILS_R1=1
124 fi
125 --
126 2.39.0