Add a check for installed packages being occluded by the working
directory when calling epytest and eunittest. This is primarily meant
to detect C extensions being missed.
Signed-off-by: Michał Górny <
mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 51 +++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 2555ce12d066..27157a003ab2 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1231,6 +1231,55 @@ _python_check_EPYTHON() {
fi
}
+# @FUNCTION: _python_check_occluded_packages
+# @INTERNAL
+# @DESCRIPTION:
+# Check if the current directory does not contain any incomplete
+# package sources that would block installed packages from being used
+# (and effectively e.g. make it impossible to load compiled extensions). +_python_check_occluded_packages() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ # DO NOT ENABLE THIS unless you're going to check for false
+ # positives before filing bugs.
+ [[ ! ${PYTHON_EXPERIMENTAL_QA} ]] && return
+
+ type -P diff &>/dev/null || return
+ [[ -z ${BUILD_DIR} || ! -d ${BUILD_DIR}/install ]] && return
+
+ local sitedir="${BUILD_D