{"id":1791,"date":"2023-02-09T17:40:17","date_gmt":"2023-02-09T16:40:17","guid":{"rendered":"https:\/\/blogs.gentoo.org\/mgorny\/?p=1791"},"modified":"2023-02-26T15:40:50","modified_gmt":"2023-02-26T14:40:50","slug":"naming-standards-compliance-of-pep517-backends","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/mgorny\/2023\/02\/09\/naming-standards-compliance-of-pep517-backends\/","title":{"rendered":"Naming standards compliance of PEP517 backends"},"content":{"rendered":"<p>PyPA maintains two standards regarding packaging artifact filenames:<\/p>\n<ul>\n<li><a rel=\"external\" href=\"https:\/\/packaging.python.org\/en\/latest\/specifications\/source-distribution-format\/#source-distribution-file-name\">Source distribution file name<\/a>, approved via <a rel=\"external\" href=\"https:\/\/peps.python.org\/pep-0625\/\">PEP 625<\/a> from 2020-07-08<\/li>\n<li><a rel=\"external\" href=\"https:\/\/packaging.python.org\/en\/latest\/specifications\/binary-distribution-format\/#file-name-convention\">Binary distribution file name convention<\/a>, originally <a rel=\"external\" href=\"https:\/\/peps.python.org\/pep-0427\/\">PEP 427<\/a> from 2013-02-15 but the escaping rules were revised in February 2021<\/li>\n<\/ul>\n<p>I have decided to give a few popular <a rel=\"external\" href=\"https:\/\/peps.python.org\/pep-0517\/\">PEP 517<\/a> backends a go and see whether they follow the standards.<\/p>\n<p><!--more--><\/p>\n<p>I have published the files used for testing in <a rel=\"external\" href=\"https:\/\/github.com\/mgorny\/pep517-testing\">mgorny\/pep517-testing<\/a> repository.  They are absolutely minimal files that satisfy the respectively build systems at the time of writing.  I have built artifacts using the popular <a rel=\"external\" href=\"https:\/\/pypi.org\/project\/build\/\">build<\/a> tool, via calling:<\/p>\n<pre><code>python -m build<\/code><\/pre>\n<p>The results are summarized in the following table:<\/p>\n<table>\n<tr>\n<th>Build system<\/th>\n<th>sdist filename<\/th>\n<th>wheel filename<\/th>\n<th>junk in sourcedir?<\/th>\n<\/tr>\n<tr>\n<td>flit-core<\/td>\n<td><code>Test-Project-1.tar.gz<\/code><\/td>\n<td><code>test_project-1-py2.py3-none-any.whl<\/code><\/td>\n<td>no<\/td>\n<\/tr>\n<tr>\n<td>hatchling<\/td>\n<td><code>test_project-1.tar.gz<\/code><\/td>\n<td><code>test_project-1-py2.py3-none-any.whl<\/code><\/td>\n<td>no<\/td>\n<\/tr>\n<tr>\n<td>meson-python<\/td>\n<td><code>test_project-1.tar.gz<\/code><\/td>\n<td><code>test_project-1-py3-none-any.whl<\/code><\/td>\n<td>dotfile<\/td>\n<\/tr>\n<tr>\n<td>pdm-backend (since 2023-02-26)<\/td>\n<td><code>test_project-1.tar.gz<\/code><\/td>\n<td><code>test_project-1-py3-none-any.whl<\/code><\/td>\n<td>no<\/td>\n<\/tr>\n<tr>\n<td>pdm-pep517 (prior to 2023-02-26)<\/td>\n<td><code>Test-Project-1.tar.gz<\/code><\/td>\n<td><code>Test_Project-1-py3-none-any.whl<\/code><\/td>\n<td>no<\/td>\n<\/tr>\n<tr>\n<td>poetry-core<\/td>\n<td><code>test_project-1.tar.gz<\/code><\/td>\n<td><code>test_project-1-py2.py3-none-any.whl<\/code><\/td>\n<td>no<\/td>\n<\/tr>\n<tr>\n<td>setuptools<\/td>\n<td><code>Test-Project-1.tar.gz<\/code><\/td>\n<td><code>Test_Project-1-py3-none-any.whl<\/code><\/td>\n<td>.egg-info<\/td>\n<\/tr>\n<\/table>\n<p>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.<\/p>\n<p>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 \u2014 probably following PEP 427.<\/p>\n<p>As a side note, setuptools left a generated .egg-info directory in the source tree, and meson-python left a <kbd>.mesonpy-native-file.ini<\/kbd> file containing a path to the Python executable in the temporary directory used by build.  Other build systems left no junk.<\/p>\n<p><ins>Update (2023-02-21):<\/ins> on top of everything, it turns out that <a rel=\"external\" href=\"https:\/\/github.com\/pypi\/warehouse\/issues\/10030\">PyPI still does not accept wheel names with dots normalized to underscores<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PyPA maintains two standards regarding packaging artifact filenames: Source distribution file name, approved via PEP 625 from 2020-07-08 Binary distribution file name convention, originally PEP 427 from 2013-02-15 but the escaping rules were revised in February 2021 I have decided to give a few popular PEP 517 backends a go and see whether they follow &hellip; <a href=\"https:\/\/blogs.gentoo.org\/mgorny\/2023\/02\/09\/naming-standards-compliance-of-pep517-backends\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Naming standards compliance of PEP517 backends&#8221;<\/span><\/a><\/p>\n","protected":false},"author":137,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[8],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/1791"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/users\/137"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/comments?post=1791"}],"version-history":[{"count":12,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/1791\/revisions"}],"predecessor-version":[{"id":1818,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/1791\/revisions\/1818"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/media?parent=1791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/categories?post=1791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/tags?post=1791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}