Louis-Philippe Véronneau pushed to branch master at lintian / lintian
Commits:
-
b1782ba5
by Maytham Alsudany at 2025-03-19T22:20:58+00:00
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:
... | ... | @@ -345,7 +345,8 @@ sub visit_installed_files { |
345 | 345 | $item->pointer)
|
346 | 346 | if $item->is_file
|
347 | 347 | && $relative eq $item->basename # "top-level"
|
348 | - &&!$self->ALLOWED_PYTHON_FILES->matches_any($item->basename, 'i');
|
|
348 | + && (!$self->ALLOWED_PYTHON_FILES->matches_any($item->basename, 'i')
|
|
349 | + || $item->basename =~ /^__init__\.py[ic]?$/);
|
|
349 | 350 | |
350 | 351 | # Prepare variables for the 'python-module-in-wrong-location' hint
|
351 | 352 | my $actual_module_path
|
1 | +__init__.py /usr/lib/python3/dist-packages
|
|
1 | 2 | bad /usr/lib/python3/dist-packages
|
2 | 3 | good /usr/lib/python3/dist-packages/subdir
|
3 | 4 | good.py /usr/lib/python3/dist-packages
|
1 | 1 | python3-foo (binary): unknown-file-in-python-module-directory [usr/lib/python3/dist-packages/bad]
|
2 | +python3-foo (binary): unknown-file-in-python-module-directory [usr/lib/python3/dist-packages/__init__.py] |