Add an explicit check for deprecated pkg_resources namespace packages
to 60python-site. The eclass handled the most common
case of installing them via the deprecated `namespace_packages`
setuptools key, but it does not handle packages that worked around
the deprecation warning by installing the file manually, or ebuilds
that did strip `namespace_packages` to silence the setuptools
deprecation warning.
Signed-off-by: Michał Górny <
mgorny@gentoo.org>
---
metadata/install-qa-check.d/60python-site | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/metadata/install-qa-check.d/60python-site b/metadata/install-qa-check.d/60python-site
index 49d4b3a1a830..4dd8d636e7cc 100644
--- a/metadata/install-qa-check.d/60python-site
+++ b/metadata/install-qa-check.d/60python-site
@@ -38,6 +38,7 @@ python_site_check() {
local bad_versions=()
local eggs=()
+ local namespace_packages=()
local outside_site=()
local stray_packages=()
local wrong_ext=()
@@ -142,6 +143,16 @@ python_site_check() {
')' -a '!' -name "*${ext_suffix}" -print0
)
+ # check for namespace packages
+ while IFS= read -d $'\0' -r f; do
+ if grep -q "pkg_resources.*declare_namespace" "${f}"
+ then
+ namespace_packages+=( "${f}" )
+ fi
+ done < <(
+ find "${sitedir}" -maxdepth 2 -type f -name '__init__.py' -print0
+ )
+
einfo "Verifying compiled files for ${impl}"
local kind pyc py
while IFS=: read -r kind p