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 26/41] python-single-r1.eclass: drop EAPI 6 support
Date: Sun, 25 Dec 2022 22:22:44
Message-Id: 20221225221552.8023-26-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/docs.eclass | 6 +++---
4 eclass/python-any-r1.eclass | 2 +-
5 eclass/python-r1.eclass | 2 +-
6 eclass/python-single-r1.eclass | 26 ++++++++------------------
7 eclass/scons-utils.eclass | 4 ++--
8 eclass/waf-utils.eclass | 4 ++--
9 6 files changed, 17 insertions(+), 27 deletions(-)
10
11 diff --git a/eclass/docs.eclass b/eclass/docs.eclass
12 index f4663c3575f..cbf35068de3 100644
13 --- a/eclass/docs.eclass
14 +++ b/eclass/docs.eclass
15 @@ -153,7 +153,7 @@ _DOCS_ECLASS=1
16 case ${DOCS_BUILDER} in
17 "sphinx"|"mkdocs")
18 # We need the python_gen_any_dep function
19 - if [[ ! ${_PYTHON_R1_ECLASS} && ! ${_PYTHON_ANY_R1_ECLASS} && ! ${_PYTHON_SINGLE_R1} ]]; then
20 + if [[ ! ${_PYTHON_R1_ECLASS} && ! ${_PYTHON_ANY_R1_ECLASS} && ! ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
21 die "distutils-r1, python-r1, python-single-r1 or python-any-r1 needs to be inherited to use python based documentation builders"
22 fi
23 ;;
24 @@ -221,7 +221,7 @@ sphinx_deps() {
25 elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then
26 die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
27 fi
28 - if [[ ${_PYTHON_SINGLE_R1} ]]; then
29 + if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
30 DOCS_DEPEND="$(python_gen_cond_dep "${deps}")"
31 else
32 DOCS_DEPEND="$(python_gen_any_dep "${deps}")"
33 @@ -284,7 +284,7 @@ mkdocs_deps() {
34 elif [[ ${DOCS_AUTODOC} != 0 && ${DOCS_AUTODOC} != 1 ]]; then
35 die "${FUNCNAME}: DOCS_AUTODOC should be set to 0 or 1"
36 fi
37 - if [[ ${_PYTHON_SINGLE_R1} ]]; then
38 + if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
39 DOCS_DEPEND="$(python_gen_cond_dep "${deps}")"
40 else
41 DOCS_DEPEND="$(python_gen_any_dep "${deps}")"
42 diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
43 index 7474ef0474b..d7d44a87f51 100644
44 --- a/eclass/python-any-r1.eclass
45 +++ b/eclass/python-any-r1.eclass
46 @@ -48,7 +48,7 @@ _PYTHON_ANY_R1_ECLASS=1
47
48 if [[ ${_PYTHON_R1_ECLASS} ]]; then
49 die 'python-any-r1.eclass can not be used with python-r1.eclass.'
50 -elif [[ ${_PYTHON_SINGLE_R1} ]]; then
51 +elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
52 die 'python-any-r1.eclass can not be used with python-single-r1.eclass.'
53 fi
54
55 diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
56 index 52822c5f47b..622a479dcfa 100644
57 --- a/eclass/python-r1.eclass
58 +++ b/eclass/python-r1.eclass
59 @@ -38,7 +38,7 @@ esac
60 if [[ ! ${_PYTHON_R1_ECLASS} ]]; then
61 _PYTHON_R1_ECLASS=1
62
63 -if [[ ${_PYTHON_SINGLE_R1} ]]; then
64 +if [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
65 die 'python-r1.eclass can not be used with python-single-r1.eclass.'
66 elif [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then
67 die 'python-r1.eclass can not be used with python-any-r1.eclass.'
68 diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
69 index 790477c1472..4d61f08c06f 100644
70 --- a/eclass/python-single-r1.eclass
71 +++ b/eclass/python-single-r1.eclass
72 @@ -7,7 +7,7 @@
73 # @AUTHOR:
74 # Author: Michał Górny <mgorny@g.o>
75 # Based on work of: Krzysztof Pawlik <nelchael@g.o>
76 -# @SUPPORTED_EAPIS: 6 7 8
77 +# @SUPPORTED_EAPIS: 7 8
78 # @PROVIDES: python-utils-r1
79 # @BLURB: An eclass for Python packages not installed for multiple implementations.
80 # @DESCRIPTION:
81 @@ -37,18 +37,13 @@
82 # For more information, please see the Python Guide:
83 # https://projects.gentoo.org/python/guide/
84
85 -case "${EAPI:-0}" in
86 - [0-5])
87 - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
88 - ;;
89 - [6-8])
90 - ;;
91 - *)
92 - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
93 - ;;
94 +case ${EAPI} in
95 + 7|8) ;;
96 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
97 esac
98
99 -if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
100 +if [[ ! ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
101 +_PYTHON_SINGLE_R1_ECLASS=1
102
103 if [[ ${_PYTHON_R1_ECLASS} ]]; then
104 die 'python-single-r1.eclass can not be used with python-r1.eclass.'
105 @@ -58,10 +53,6 @@ fi
106
107 inherit python-utils-r1
108
109 -fi
110 -
111 -EXPORT_FUNCTIONS pkg_setup
112 -
113 # @ECLASS_VARIABLE: PYTHON_COMPAT
114 # @REQUIRED
115 # @DESCRIPTION:
116 @@ -257,8 +248,6 @@ _python_single_set_globals() {
117 _python_single_set_globals
118 unset -f _python_single_set_globals
119
120 -if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
121 -
122 # @FUNCTION: python_gen_useflags
123 # @USAGE: [<pattern>...]
124 # @DESCRIPTION:
125 @@ -463,5 +452,6 @@ python-single-r1_pkg_setup() {
126 [[ ${MERGE_TYPE} != binary ]] && python_setup
127 }
128
129 -_PYTHON_SINGLE_R1=1
130 fi
131 +
132 +EXPORT_FUNCTIONS pkg_setup
133 diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
134 index 619230ecca6..8d0076de97e 100644
135 --- a/eclass/scons-utils.eclass
136 +++ b/eclass/scons-utils.eclass
137 @@ -103,7 +103,7 @@ if [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then
138 python_has_version "${SCONS_DEPEND}[${PYTHON_USEDEP}]"
139 }
140 python_check_deps() { scons-utils_python_check_deps; }
141 -elif [[ ${_PYTHON_SINGLE_R1} ]]; then
142 +elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
143 # when using python-single-r1, use PYTHON_USEDEP API
144 BDEPEND="
145 $(python_gen_cond_dep "${SCONS_DEPEND}[\${PYTHON_USEDEP}]")
146 @@ -139,7 +139,7 @@ escons() {
147 eerror "the ebuild did not call the appropriate eclass function before calling scons."
148 if [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then
149 eerror "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()."
150 - elif [[ ${_PYTHON_SINGLE_R1} ]]; then
151 + elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
152 eerror "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()."
153 else # python-r1
154 eerror "Please ensure that python_setup is called before escons, or that escons"
155 diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
156 index 61994e73bed..2f4a20cd457 100644
157 --- a/eclass/waf-utils.eclass
158 +++ b/eclass/waf-utils.eclass
159 @@ -41,7 +41,7 @@ waf-utils_src_configure() {
160 debug-print-function ${FUNCNAME} "$@"
161
162 local fail
163 - if [[ ! ${_PYTHON_ANY_R1_ECLASS} && ! ${_PYTHON_SINGLE_R1} && ! ${_PYTHON_R1_ECLASS} ]]; then
164 + if [[ ! ${_PYTHON_ANY_R1_ECLASS} && ! ${_PYTHON_SINGLE_R1_ECLASS} && ! ${_PYTHON_R1_ECLASS} ]]; then
165 eerror "Using waf-utils.eclass without any python-r1 suite eclass is not supported."
166 eerror "Please make sure to configure and inherit appropriate -r1 eclass."
167 eerror "For more information and examples, please see:"
168 @@ -53,7 +53,7 @@ waf-utils_src_configure() {
169 eerror "the ebuild did not call the appropriate eclass function before calling waf."
170 if [[ ${_PYTHON_ANY_R1_ECLASS} ]]; then
171 eerror "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()."
172 - elif [[ ${_PYTHON_SINGLE_R1} ]]; then
173 + elif [[ ${_PYTHON_SINGLE_R1_ECLASS} ]]; then
174 eerror "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()."
175 else # python-r1
176 eerror "Please ensure that python_setup is called before waf-utils_src_configure(),"
177 --
178 2.39.0