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 03/28] python-utils-r1.eclass: Remove python_optimize support for py<3.5
Date: Sun, 20 Jun 2021 09:57:12
Message-Id: 20210620095552.625633-4-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/28] python-r1 suite EAPI 8 support/cleanup by "Michał Górny"
1 Remove the support code for Python 2.7, <3.5, as well as PyPy2.7. These
2 are no longer supported at runtime, so byte-compiling should not be used
3 for these impls.
4
5 Signed-off-by: Michał Górny <mgorny@g.o>
6 ---
7 eclass/python-utils-r1.eclass | 8 ++------
8 1 file changed, 2 insertions(+), 6 deletions(-)
9
10 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
11 index e164b9c20eb9..ad8d368e27c7 100644
12 --- a/eclass/python-utils-r1.eclass
13 +++ b/eclass/python-utils-r1.eclass
14 @@ -626,18 +626,14 @@ python_optimize() {
15 instpath=/${instpath##/}
16
17 case "${EPYTHON}" in
18 - python2.7|python3.[34])
19 - "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}"
20 - "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}"
21 - ;;
22 python*|pypy3)
23 - # both levels of optimization are separate since 3.5
24 + # both levels of optimization are separate since py3.5
25 "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}"
26 "${PYTHON}" -O -m compileall -q -f -d "${instpath}" "${d}"
27 "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}"
28 ;;
29 *)
30 - "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}"
31 + die "Unknown impl for python_optimize: ${EPYTHON}"
32 ;;
33 esac
34 done
35 --
36 2.32.0