Louis-Philippe Véronneau pushed to branch master at lintian / lintian
Commits:
b1782ba5 by Maytham Alsudany at 2025-03-19T22:20:58+00:00
Emit unknown-file-in-python-module-directory tag if __init__.py found in
dist-packages root
Closes: #1071061
- - - - -
4 changed files:
- lib/Lintian/Check/Languages/Python.pm
-
t/recipes/checks/languages/python/files-unknown-file-in-python-module-directory/build-spec/debian/install
- +
t/recipes/checks/languages/python/files-unknown-file-in-python-module-directory/build-spec/orig/__init__.py
-
t/recipes/checks/languages/python/files-unknown-file-in-python-module-directory/eval/hints
Changes:
=====================================
lib/Lintian/Check/Languages/Python.pm
=====================================
@@ -345,7 +345,8 @@ sub visit_installed_files {
$item->pointer)
if $item->is_file
&& $relative eq $item->basename # "top-level"
- &&!$self->ALLOWED_PYTHON_FILES->matches_any($item->basename, 'i');
+ && (!$self->ALLOWED_PYTHON_FILES->matches_any($item->basename, 'i')
+ || $item->basename =~ /^__init__\.py[ic]?$/);
# Prepare variables for the 'python-module-in-wrong-location' hint
my $actual_module_path
=====================================
t/recipes/checks/languages/python/files-unknown-file-in-python-module-directory/build-spec/debian/install
=====================================
@@ -1,3 +1,4 @@
+__init__.py /usr/lib/python3/dist-packages
bad /usr/lib/python3/dist-packages
good /usr/lib/python3/dist-packages/subdir
good.py /usr/lib/python3/dist-packages
=====================================
t/recipes/checks/languages/python/files-unknown-file-in-python-module-directory/build-spec/orig/__init__.py
=====================================
=====================================
t/recipes/checks/languages/python/files-unknown-file-in-python-module-directory/eval/hints
=====================================
@@ -1 +1,2 @@
python3-foo (binary): unknown-file-in-python-module-directory
[usr/lib/python3/dist-packages/bad]
+python3-foo (binary): unknown-file-in-python-module-directory
[usr/lib/python3/dist-packages/__init__.py]
View it on GitLab:
https://salsa.debian.org/lintian/lintian/-/commit/b1782ba52032f54c226c51c218b050bef18dec93
--
View it on GitLab:
https://salsa.debian.org/lintian/lintian/-/commit/b1782ba52032f54c226c51c218b050bef18dec93
You're receiving this email because of your account on salsa.debian.org.