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 19/30] python-utils-r1.eclass: Remove python_is_python3
Date: Sun, 06 Feb 2022 12:54:55
Message-Id: 20220206124841.1299133-20-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/30] One batch of Python eclass updates to rule them all by "Michał Górny"
1 Signed-off-by: Michał Górny <mgorny@g.o>
2 ---
3 eclass/distutils-r1.eclass | 8 +++-----
4 eclass/python-utils-r1.eclass | 17 -----------------
5 eclass/tests/python-utils-r1.sh | 5 -----
6 3 files changed, 3 insertions(+), 27 deletions(-)
7
8 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
9 index 295263b62420..7f9cf242c421 100644
10 --- a/eclass/distutils-r1.eclass
11 +++ b/eclass/distutils-r1.eclass
12 @@ -333,11 +333,9 @@ unset -f _distutils_set_globals
13 # (allowing any implementation). If multiple values are specified,
14 # implementations matching any of the patterns will be accepted.
15 #
16 -# The patterns can be either fnmatch-style patterns (matched via bash
17 -# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
18 -# appropriately all enabled Python 2/3 implementations (alike
19 -# python_is_python3). Remember to escape or quote the fnmatch patterns
20 -# to prevent accidental shell filename expansion.
21 +# The patterns are fnmatch-style patterns (matched via bash == operator
22 +# against PYTHON_COMPAT values). Remember to escape or quote the fnmatch
23 +# patterns to prevent accidental shell filename expansion.
24 #
25 # If the restriction needs to apply conditionally to a USE flag,
26 # the variable should be set conditionally as well (e.g. in an early
27 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
28 index a2de1c2b506e..a42ae66d9c89 100644
29 --- a/eclass/python-utils-r1.eclass
30 +++ b/eclass/python-utils-r1.eclass
31 @@ -945,23 +945,6 @@ _python_wrapper_setup() {
32 export PATH PKG_CONFIG_PATH
33 }
34
35 -# @FUNCTION: python_is_python3
36 -# @USAGE: [<impl>]
37 -# @DESCRIPTION:
38 -# Check whether <impl> (or ${EPYTHON}) is a Python3k variant
39 -# (i.e. uses syntax and stdlib of Python 3.*).
40 -#
41 -# Returns 0 (true) if it is, 1 (false) otherwise.
42 -python_is_python3() {
43 - eqawarn "${FUNCNAME} is deprecated, as Python 2 is not supported anymore"
44 - [[ ${EAPI} == [67] ]] || die "${FUNCNAME} banned in EAPI ${EAPI}"
45 -
46 - local impl=${1:-${EPYTHON}}
47 - [[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON"
48 -
49 - [[ ${impl} == python3* || ${impl} == pypy3 ]]
50 -}
51 -
52 # @FUNCTION: python_fix_shebang
53 # @USAGE: [-f|--force] [-q|--quiet] <path>...
54 # @DESCRIPTION:
55 diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
56 index 7ba4a864ff10..0244ce26ad0f 100755
57 --- a/eclass/tests/python-utils-r1.sh
58 +++ b/eclass/tests/python-utils-r1.sh
59 @@ -156,11 +156,6 @@ fi
60 test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:0='
61 test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
62
63 -test_is "python_is_python3 python2.7" 1
64 -test_is "python_is_python3 python3.2" 0
65 -test_is "python_is_python3 pypy" 1
66 -test_is "python_is_python3 pypy3" 0
67 -
68 # generic shebangs
69 test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6'
70 test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
71 --
72 2.35.1