It’s not specific to sdists, it affects wheels as well.
Currently, everyone using a . in their name with setuptools (which I believe is still by far the most used build backend) works when uploading to PyPI. The tools that implement the specs as written have never been able to upload to PyPI.
If PyPI switches to enforcing the specs as written, then we suddenly break all of the existing projects who have been successfully using . in their name, sometimes for 10+ years, in order to fix the projects who have never been able to successfully upload to PyPI.
If PyPI just relaxes the rules, and accepts anything, then it’s likely that we never align the build backends into a single behavior, and regardless of what the spec says, the de facto implementation will be what PyPI implements (i.e. that normalization is not required). It also leaves a “missing stair”, we know there are widely deployed tools in the wild that rely on there being a . in the name, those tools are just going to randomly break for users depending on what build backend they happen to use for their project.
all modern build systems do follow the “new” wheel naming and PEP 625
setuptools is the only build system that doesn’t follow the modern spec
When I looked in February of this year, it was not just setuptools. In fact in this very issue you can see the filename that Barry got was flufl.i18n-5.0-py3-none-any.whl from PDM.
Here’s my results from Feb 25th, 2023, this may have changed since then, I haven’t re-run these to see.
| Build System |
sdist filename |
wheel filename |
| flit-core |
Test.Project-1.tar.gz |
test_project-1-py2.py3-none-any.whl |
| hatchling |
test_project-1.tar.gz |
test_project-1-py2.py3-none-any.whl |
| meson-python |
test_project-1.tar.gz |
test_project-1-py3-none-any.whl |
| pdm-pep517 |
Test.Project-1.tar.gz |
Test.Project-1-py3-none-any.whl |
| poetry-core |
test_project-1.tar.gz |
test_project-1-py2.py3-none-any.whl |
| setuptools |
Test.Project-1.tar.gz |
Test.Project-1-py3-none-any.whl |
Note that, at that time, setuptools, pdm-pep517, and flit-core all produced either sdists or wheels that were not normalized.
I haven’t checked how many of those projects always emit normalized versions, PyPI doesn’t enforce normalized versions, which is also part of the spec, and I assume there’s a non zero number of them that don’t normalize versions.
I’ve repeatedly said that I don’t personally care, at all, what the filename format is. It is basically the least interesting thing in the world to discuss. What I care is that we don’t have some flag day that breaks large numbers of users and that we don’t create a situation where to avoid that, the tools necessarily have to ignore the spec.
The specs as written, have no plan whatsoever for dealing how to introduce the now stricter requirement to the ecosystem, and afaict took no efforts to minimize the breakage, because the backwards incompatible change to the wheel spec was not really discussed, and was effectively added “by accident”.
I’m also not the only person with a commit bit on PyPI. I’ve voiced my opinion that I think the specs force us to ignore them or have a flag day that breaks users that are currently working, and because of that I’m not willing to make a change to PyPI. If the other admins disagree with me they’re able to merge a change without my approval, we have no requirement for unanimous consent for merges in PyPI.
Weird how you’re demanding that PyPI does the work of figuring out how to implement a backwards incompatible change that was introduced without any migration plan. I guess PyPI doesn’t count as volunteer open source?
Like this is basically a fundamental part of change management, determining how to actually roll a change out in the ecosystem. That was skipped for these backwards incompatible changes, and that is what is causing the problem here. I know that the people involved did not intentionally do that, and I believe it was entirely accidental.
The need to manage the roll out of the change doesn’t go away because it was skipped though. All I’ve ever asked is that someone figure out how in the world this backwards incompatibility is supposed to get rolled out in an incremental way across the ecosystem, and get agreement on that being the path forward, because there’s open questions on what that should look like.
- Should PyPI just allow any form of the name normalized or not? If so this means that it’s unlikely that tools are going to be able to assume that names will be normalized, because one of the ways we’ve shifted the ecosystem is through enforcement on PyPI. Is that fine?
- If the rule isn’t important enough to enforce it on PyPI, is it really a MUST?
- Should PyPI rename the files upon upload? Should we apply it retroactively? If we do this does it matter that the filename and the
.dist-info will not have matching names, will that break anything? Do any major tools out there rely on PyPI not renaming the files upon upload?
- A quick skim of twine looks like this would break at least the feature to skip uploading existing files. Is that fine? No idea if there are other tools or even places in twine.
- Should PyPI hard reject non-normalized filenames? What timeline makes sense to do that in? How many projects would that break? Are we as a community fine with that amount of breakage?
- Are the backwards compatibility concerns too hard to sort out and should we relax the spec to allow non-normalized names as well?
- Something else?