Add discussion of package formats, expanding "Wheel vs Egg" discussion by jeanas · Pull Request #1397 · pypa/packaging.python.org

I want to dispute a point made in this discussion:

Wheel archives do not include .pyc files. Therefore, when the distribution only contains Python files (i.e. no compiled extensions), and is compatible with Python 2 and 3, it’s possible for a wheel to be “universal”, similar to an sdist.

This differs from the explanation offered for wheels specifically:

Wheel, being an installation format that is intended to work across multiple versions of Python, does not generally include .pyc files.

(Emphasis mine.)

There is nothing in the description there (nor in the original PEP), as far as I can tell, which forbids .pyc files in a wheel. In fact, by my understanding, it's perfectly valid to publish a wheel (as long as the wheel tags specify the Python version, since the bytecode will be specific to that version) which contains only .pyc representations of the Python code; or, indeed, where any Python code included is only a minimal wrapper for a native-code compiled library. (As far as I'm aware, there's no requirement for packages on PyPI to be open-source, either.)

If .egg files were required (I can't recall) to contain .pyc files (or maybe it's just that Setuptools was the only game in town, and it only made eggs with .pyc files?), and were thus necessarily specific to a Python version, this should be clarified (e.g.: "Wheel archives do not have to include .pyc files"). Otherwise the point should be removed entirely, since the distinction doesn't really exist.