Naming standards compliance of PEP517 backends

PyPA maintains two standards regarding packaging artifact filenames:

I have decided to give a few popular PEP 517 backends a go and see whether they follow the standards.

I have published the files used for testing in mgorny/pep517-testing repository. They are absolutely minimal files that satisfy the respectively build systems at the time of writing. I have built artifacts using the popular build tool, via calling:

python -m build

The results are summarized in the following table:

Build system sdist filename wheel filename junk in sourcedir?
flit-core Test-Project-1.tar.gz test_project-1-py2.py3-none-any.whl no
hatchling test_project-1.tar.gz test_project-1-py2.py3-none-any.whl no
meson-python test_project-1.tar.gz test_project-1-py3-none-any.whl dotfile
pdm-backend (since 2023-02-26) test_project-1.tar.gz test_project-1-py3-none-any.whl no
pdm-pep517 (prior to 2023-02-26) Test-Project-1.tar.gz Test_Project-1-py3-none-any.whl no
poetry-core test_project-1.tar.gz test_project-1-py2.py3-none-any.whl no
setuptools Test-Project-1.tar.gz Test_Project-1-py3-none-any.whl .egg-info

Of the tested build systems, only hatchling, meson-python and poetry-core normalized sdist names according to PEP 625. The remaining build systems reproduced the project name exactly.

All projects except for pdm-pep517 and setuptools normalized wheel names according to the current specification. These two replaced hyphens but left uppercase characters in — probably following PEP 427.

As a side note, setuptools left a generated .egg-info directory in the source tree, and meson-python left a .mesonpy-native-file.ini file containing a path to the Python executable in the temporary directory used by build. Other build systems left no junk.

Update (2023-02-21): on top of everything, it turns out that PyPI still does not accept wheel names with dots normalized to underscores

Leave a Reply

Your email address will not be published.