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] distutils-r1.eclass: Set PATH in distutils_install_for_testing
Date: Sat, 01 Aug 2020 20:37:17
Message-Id: 20200801203707.84961-1-mgorny@gentoo.org
1 Make distutils_install_for_testing set PATH so that newly-installed
2 scripts are available in the testing environment. Make PATH local
3 in all sub-phases to make modifications safe.
4
5 Signed-off-by: Michał Górny <mgorny@g.o>
6 ---
7 eclass/distutils-r1.eclass | 6 ++++++
8 1 file changed, 6 insertions(+)
9
10 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
11 index 092c0887d878..e0e7a945ab87 100644
12 --- a/eclass/distutils-r1.eclass
13 +++ b/eclass/distutils-r1.eclass
14 @@ -561,6 +561,7 @@ distutils_install_for_testing() {
15 TEST_DIR=${BUILD_DIR}/test
16 local bindir=${TEST_DIR}/scripts
17 local libdir=${TEST_DIR}/lib
18 + PATH=${bindir}:${PATH}
19 PYTHONPATH=${libdir}:${PYTHONPATH}
20
21 local add_args=(
22 @@ -951,6 +952,11 @@ distutils-r1_run_phase() {
23 fi
24 local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
25
26 + # make PATH local for distutils_install_for_testing calls
27 + # it makes little sense to let user modify PATH in per-impl phases
28 + # and _all() already localizes it
29 + local -x PATH=${PATH}
30 +
31 # Bug 559644
32 # using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to
33 # problems in setup.py scripts that try to import modules/packages from that path
34 --
35 2.28.0