#1029808 lintian: warnings related to *.pyc *.pyo __pycache__/

#1029808#5
Date:
2023-01-28 01:20:25 UTC
From:
To:
The *.pyc *.pyo files are Python bytecode and are almost always
generated from Python source code. Since Python 3 these are usually
stored in a __pycache__/ directory.

Since these files are not source code, they should not be present in
the Debian source packages, but there are hundreds of them in Debian:

   $ apt-file -I dsc search --regex '\.py[co]$' | wc -l
   507

Please complain on *.pyc *.pyo being present in Debian source packages.

Please also check that when they are present, that they have a *.py
source file present. When it is in the same directory it will have the
same name but .py extension. When the generated files are in a
__pycache__/ directory then *.pyc file name will contain .cpython-NN
but the *.py source file will not.

Please also complain about other files in __pycache__/ directories.
Since these dirs are caches and caches are often ignored by various
tools, the other files could get lost from backups, VCS repos, etc.

   $ apt-file -I dsc search __pycache__/ | grep -vF .cpython-
   ack: /t/swamp/__pycache__/notes.pl
   asciidoc: /tests/__test_data__/plugin/backends/__pycache__/.gitkeep
   mypy-protobuf: /test/generated/testproto/__pycache__/__init__.py
   mypy-protobuf: /test/generated/testproto/dot/com/__pycache__/__init__.py