Skip to content
Advertisement

Wheel Incompatibility between Python Minor Versions

I’m releasing a package on PyPi which will support Python 3.6+, and would like to build as few wheels as possible.

I’ve read up on Python’s packaging system for wheels and looked at the NumPy project for an example. Reading PEP 513 and PEP 571 was also insightful.

Here’s the question: why are wheels forwards-incompatible with Python minor version changes?

Upgrading from 3.5 to 3.6, for example, brings f-strings. But it seems like a wheel built with Python 3.5 (not using f-strings) should be able to run just fine on a Python 3.6 environment. What’s the issue here?

Advertisement

Answer

Code written in pure Python in a 2-and-3 compatible way can be released in a universal wheel. One wheel that fits all Python versions. Example: https://pypi.org/project/SQLObject/#files

But projects that include modules written in C must be released separately for every platform (processor architecture and 32/64-bitness), OS and Python version simply because the C code must be compiled differently. Example: https://pypi.org/project/Cheetah3/#files

PS. Full disclosure: I’m the maintainer for both projects used as examples.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement