Commit b76a4797 authored by Chris Lamb's avatar Chris Lamb 💬

Check for packages that ship non-Python files in top-level Python module...

Check for packages that ship non-Python files in top-level Python module directories such as /usr/lib/python3/dist-packages.
parent 4eb70c9a
Pipeline #21987 failed with stage
in 0 seconds
......@@ -2014,3 +2014,12 @@ Info: The listed file appears to use one or more of the binaries
In most cases you will need to add a <tt>Depends</tt>,
<tt>Recommends</tt>, <tt>Pre-Depends</tt> or <tt>Suggests</tt>
on <tt>sensible-utils</tt>.
Tag: unknown-file-in-python-module-directory
Severity: important
Certainty: certain
Info: This package installs the specifiied "non-Python" file in the
top-level of a Python library directory.
This was either a mistake and/or will likely to cause conflicts with other
......@@ -38,6 +38,7 @@ my $LOCALE_CODES = Lintian::Data->new('files/locale-codes', qr/\s++/);
= Lintian::Data->new('files/incorrect-locale-codes', qr/\s++/);
my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/);
my $ALLOWED_PYTHON_FILES = Lintian::Data->new('files/allowed-python-files');
my $GENERIC_HEADER_FILES = Lintian::Data->new('files/generic-header-files');
my $GENERIC_PYTHON_MODULES= Lintian::Data->new('files/generic-python-modules');
my $ALLOWED_ANCIENT_FILES = Lintian::Data->new('files/allowed-ancient-files');
......@@ -1457,6 +1458,10 @@ sub run {
tag 'python-module-has-overly-generic-name', $fname, "($1)"
if $rest =~ m,^($regex)(?:\.py|/__init__\.py)$,i;
tag 'unknown-file-in-python-module-directory', $fname
if $file->is_file
and $rest eq $file->basename # "top-level"
and not $ALLOWED_PYTHON_FILES->matches_any($file->basename, 'i');
if ($fname =~ m,/icons/[^/]+/(\d+)x(\d+)/(?!animations/).*\.png$,){
# Regular expressions (/i) of filenames that are allowed in top-level Python
# directories such as /usr/lib/python3/dist-packages
......@@ -5,6 +5,9 @@ lintian (2.5.109) UNRELEASED; urgency=medium
* checks/
+ [CL] Avoid false-positives when using the blends-dev package for the
package-does-not-use-debhelper-or-cdbs tag. (Closes: #910453)
* checks/files.{pm,desc}:
+ [CL] Check for packages that ship non-Python files in top-level
Python module directories such as /usr/lib/python3/dist-packages.
* checks/scripts.{desc,pm}:
+ [CL] Check for packages missing versioned dependencies on
init-system-helpers. (Closes: #910594)
Testname: files-python-module-has-overly-generic-name
Version: 1.0
Description: Test tags for Python modules with overly generic names
Source: {$source}
Priority: optional
Section: python
Maintainer: {$author}
Standards-Version: {$standards_version}
Build-Depends: {$build_depends}
Rules-Requires-Root: no
Package: python3-foo
Architecture: all
Depends: $\{misc:Depends\}, python3
Description: {$description}
This is a test package designed to exercise some feature or tag of
Lintian. It is part of the Lintian test suite and may do very odd
things. It should not be installed like a regular package. It may
be an empty package.
bad /usr/lib/python3/dist-packages
good /usr/lib/python3/dist-packages/subdir /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages/subdir
Testname: files-unknown-file-in-python-module-directory
Version: 1.0
Description: Test for invalid files in Python module directory
E: python3-foo: unknown-file-in-python-module-directory usr/lib/python3/dist-packages/bad
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment