PEP 777: How to Re-invent the Wheel

the .dist-info metadata directory MUST be placed at the root of the archive without any compression

No compression at all seems a bit wasteful, with things like license files being put in .dist-info.
Also, AFAIK the current default in setuptools is to use deflate for the whole archive, and pip itself publishes deflate-compressed wheels. I don’t think there’s any practical reason against requiring support for it.
In CPython, zlib is nominally an optional module, but I think that should change.

I suggest:

  • Allowing deflate as well as no compression. (I guess BZIP2 & LZMA are unnecessarily progressive for this use case.)
  • Limiting the restriction to .dist-info/METADATA (i.e. the file that contains the version). This would allow new wheel versions to specify other compression schemes for individual files – after careful consideration of course.
    Practically: tools should either check the version in the METADATA file before looking at the whole .dist-info directory, or assume that a failure to unpack .dist-info is due to an incompatible wheel version.

+1 to .wheel by the way :‍)

1 Like