.pyc files are included in wheels
See original GitHub issue@lamby filed https://bugs.debian.org/1005825 in Debian:
Whilst working on the Reproducible Builds effort we noticed that hatchling could not be built reproducibly. This is because it included the checksums of (unshipped)
.pyc
files in theRECORD
file. A patch is attached that strips them out; this change is analogous to a similar conditional later in thewheel.py
file.
He supplied a patch to strip .pyc
files from RECORD
.
But I’d suggest that we go a step further and exclude the .pyc
files from the generated wheels, entirely. While Debian didn’t ship the .pyc
files, due to packaging tooling, they are in generated wheels.
This would be what most other packaging tools do, and in line with PEP 427, which states:
- Wheel, being an installation format that is intended to work across multiple versions of Python, does not generally include
.pyc
files.
I would have filed a PR to do this, but I’m not entirely sure what your preferred mechanism to implement the exclusion would be. It could be defaulting to exclude __pycache__
directories, or .pyc
files, using the existing exclusion mechanisms, or a hardcoded exclusion for .pyc
files in recurse_project_files()
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
(Yep, not wedded to the idea of only stripping the
.pyc
references fromRECORD
; I was merely following the principle of providing the minimal possible patch.)Thanks!