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 01/18] python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest
Date: Sat, 04 Jun 2022 09:04:13
Message-Id: 20220604090334.4003-2-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches by "Michał Górny"
1 The test suites of pytest plugins cause additional *-pytest-*.pyc files
2 to be created. Remove them in order to prevent them from being
3 installed alongside the package.
4
5 Closes: https://bugs.gentoo.org/847235
6 Signed-off-by: Michał Górny <mgorny@g.o>
7 ---
8 eclass/python-utils-r1.eclass | 5 +++++
9 1 file changed, 5 insertions(+)
10
11 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
12 index 67dc5bf754d6..9eb068d3b13f 100644
13 --- a/eclass/python-utils-r1.eclass
14 +++ b/eclass/python-utils-r1.eclass
15 @@ -1318,6 +1318,11 @@ epytest() {
16
17 # remove common temporary directories left over by pytest plugins
18 rm -rf .hypothesis .pytest_cache || die
19 + # pytest plugins create additional .pyc files while testing
20 + # see e.g. https://bugs.gentoo.org/847235
21 + if [[ -n ${BUILD_DIR} && -d ${BUILD_DIR} ]]; then
22 + find "${BUILD_DIR}" -name '*-pytest-*.pyc' -delete || die
23 + fi
24
25 return ${ret}
26 }
27 --
28 2.35.1