1 |
commit: 627a63a27f3b1a37ce3f2800c1d70ea2c9ecd882 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 31 08:15:08 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 7 06:53:44 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=627a63a2 |
7 |
|
8 |
python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest |
9 |
|
10 |
The test suites of pytest plugins cause additional *-pytest-*.pyc files |
11 |
to be created. Remove them in order to prevent them from being |
12 |
installed alongside the package. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/847235 |
15 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
16 |
|
17 |
eclass/python-utils-r1.eclass | 5 +++++ |
18 |
1 file changed, 5 insertions(+) |
19 |
|
20 |
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass |
21 |
index 67dc5bf754d6..9eb068d3b13f 100644 |
22 |
--- a/eclass/python-utils-r1.eclass |
23 |
+++ b/eclass/python-utils-r1.eclass |
24 |
@@ -1318,6 +1318,11 @@ epytest() { |
25 |
|
26 |
# remove common temporary directories left over by pytest plugins |
27 |
rm -rf .hypothesis .pytest_cache || die |
28 |
+ # pytest plugins create additional .pyc files while testing |
29 |
+ # see e.g. https://bugs.gentoo.org/847235 |
30 |
+ if [[ -n ${BUILD_DIR} && -d ${BUILD_DIR} ]]; then |
31 |
+ find "${BUILD_DIR}" -name '*-pytest-*.pyc' -delete || die |
32 |
+ fi |
33 |
|
34 |
return ${ret} |
35 |
} |