--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: [checks/files] false-positive package-installs-python-bytecode
- From: Jakub Wilk <jwilk@debian.org>
- Date: Wed, 5 Oct 2011 13:45:26 +0200
- Message-id: <20111005114526.GA5592@jwilk.net>
Package: lintian
Version: 2.5.3
Severity: normal
Tags: patch
$ lintian -F jython_2.5.1-2_all.deb
E: jython: package-installs-python-bytecode usr/share/jython/Lib/test/pbcvm/test/test_builtin_pyc.pyc
E: jython: package-installs-python-bytecode usr/share/jython/Lib/test/pbcvm/test/test_exceptions_pyc.pyc
E: jython: package-installs-python-bytecode usr/share/jython/Lib/test/pbcvm/test/test_types_pyc.pyc
I consider these false-positives, because the files are for testing
purposes only. (Since the tag causes fatal auto-reject, it's quite
important to avoid false-positives...) I propose to exclude all
test_*_pyc.py[co] files from the check.
--
Jakub Wilk
diff --git a/checks/files b/checks/files
--- a/checks/files
+++ b/checks/files
@@ -767,7 +767,8 @@
# skip any file installed inside a __pycache__ directory
# - we have a separate check for that directory.
if ($file =~ m,\.py[co]$,o && $file !~ m,/__pycache__/,o) {
- tag 'package-installs-python-bytecode', $file;
+ tag 'package-installs-python-bytecode', $file
+ unless $file =~ m,/test_[^/]+_pyc\.py[co]$,o;
}
# ---------------- __pycache__ (directory for pyc/pyo files)
--- End Message ---
--- Begin Message ---
Hi,
> $ lintian -F jython_2.5.1-2_all.deb
> E: jython: package-installs-python-bytecode usr/share/jython/Lib/test/pbcvm/test/test_builtin_pyc.pyc
The installation package jython_2.7.1+repack1-4_all.deb no longer
ships Python bytecode. The maintainer apparently adopted Lintian's
advice to remove the files. The point is moot.
> However, I would like to see the
> Python Policy clarify such an exception to its §2.6.
The Python policy continues to state the same as quoted above
(although the section numbering changed to §3.7, Modules
Byte-Compilation):
"If a binary package provides any binary-independent modules (foo.py
files), the corresponding byte-compiled modules (foo.pyc files) and
optimized modules (foo.pyo files) must not ship in the package.
Instead, they should be generated in the package's post-install
script, and removed in the package's pre-remove script. The package's
prerm has to make sure that both foo.pyc and foo.pyo are removed."
The policy still allows the variant reading suggested earlier in the
bug, but the FTP Master autoreject policy [1] continues to disallow
overrides. It does not seem to have changed for eight years.
Interestingly, one package seems to receive special treatment, as
shown on lintian.d.o:
python3-ndg-httpsclient 0.5.1-4 (binary) (Gianfranco Costamagna
<locutusofborg@debian.org>)
usr/lib/python2.7/dist-packages/ndg/__init__.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/__init__.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/https.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/ssl_context_util.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/ssl_peer_verification.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/ssl_socket.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/subj_alt_name.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/test/__init__.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/test/test_https.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/test/test_urllib2.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/test/test_utils.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/urllib2_build_opener.pyc
usr/lib/python2.7/dist-packages/ndg/httpsclient/utils.pyc
Closing this bug.
Kind regards
Felix Lechner
[1] https://ftp-master.debian.org/static/lintian.tags
--- End Message ---