Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 3/3] distutils-r1.eclass: Require EPYTHON to be set
Date: Sat, 06 Feb 2021 11:55:04
Message-Id: 20210206115408.118297-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/3] distutils-r1.eclass: Fix setuptools without setup.py by "Michał Górny"
1 There is no context in which the function is called without EPYTHON
2 set, so require it to be set instead of adding a fallback.
3
4 Signed-off-by: Michał Górny <mgorny@g.o>
5 ---
6 eclass/distutils-r1.eclass | 4 +++-
7 1 file changed, 3 insertions(+), 1 deletion(-)
8
9 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
10 index cb64938c8c32..780becc3ace9 100644
11 --- a/eclass/distutils-r1.eclass
12 +++ b/eclass/distutils-r1.eclass
13 @@ -518,6 +518,8 @@ distutils_enable_tests() {
14 esetup.py() {
15 debug-print-function ${FUNCNAME} "${@}"
16
17 + [[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
18 +
19 local die_args=()
20 [[ ${EAPI} != [45] ]] && die_args+=( -n )
21
22 @@ -529,7 +531,7 @@ esetup.py() {
23 setup_py=( -m pyproject2setuppy.main )
24 fi
25
26 - set -- "${EPYTHON:-python}" "${setup_py[@]}" "${mydistutilsargs[@]}" "${@}"
27 + set -- "${EPYTHON}" "${setup_py[@]}" "${mydistutilsargs[@]}" "${@}"
28
29 echo "${@}" >&2
30 "${@}" || die "${die_args[@]}"
31 --
32 2.30.0