summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-31 10:15:08 +0200
committerMichał Górny <mgorny@gentoo.org>2022-06-07 08:53:44 +0200
commit627a63a27f3b1a37ce3f2800c1d70ea2c9ecd882 (patch)
tree0032cbbc718f9cd69d05781f9bddef3e72d4850b /eclass/python-utils-r1.eclass
parentprofiles: Add android to EULA license group (diff)
downloadgentoo-627a63a27f3b1a37ce3f2800c1d70ea2c9ecd882.tar.gz
gentoo-627a63a27f3b1a37ce3f2800c1d70ea2c9ecd882.tar.bz2
gentoo-627a63a27f3b1a37ce3f2800c1d70ea2c9ecd882.zip
python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest
The test suites of pytest plugins cause additional *-pytest-*.pyc files to be created. Remove them in order to prevent them from being installed alongside the package. Closes: https://bugs.gentoo.org/847235 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass5
1 files changed, 5 insertions, 0 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 67dc5bf754d6..9eb068d3b13f 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1318,6 +1318,11 @@ epytest() {
# remove common temporary directories left over by pytest plugins
rm -rf .hypothesis .pytest_cache || die
+ # pytest plugins create additional .pyc files while testing
+ # see e.g. https://bugs.gentoo.org/847235
+ if [[ -n ${BUILD_DIR} && -d ${BUILD_DIR} ]]; then
+ find "${BUILD_DIR}" -name '*-pytest-*.pyc' -delete || die
+ fi
return ${ret}
}