-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Namespace package with leading _
in package name is rejected for upload
#14806
Comments
This looks like a bug in
Which, based on my interpretation, means it should be producing |
Yeah, I agree with your interpretation @di. It seem then that the specification does not allow for a namespace package to have a leading |
There seems to be disagreement between PEP 508's names section and PEP 503's normalized names section. 508's states:
However 503 states:
This disagreement suggests that python package names are not guaranteed to be unique. Meaning two valid unique python package names that pass the PyPI regex may result in the same package name post normalization. |
Pulling from the list of published packages on PyPI, 28 packages can no longer be updated because of this bug.
|
@di, can you revisit this? In the mean time I have no way to update my package on PyPI. |
This is pypa/wheel#440. Until that issue is resolved, you can work around this by renaming the necessary files yourself:
The upload will succeed, the project name will be displayed the same on PyPI and the distribution can be installed as expected (example). Since PyPI is doing the 'right' thing, per the specification, I don't think we should introduce any changes here to be more lax in what we accept, and we can probably close this in favor of pypa/wheel#440. |
Thanks for the guidance, @di! That solved the issue. |
Related to:
#14763
#14156
Describe the bug
Cannot upload distribution of namespace package where package name has leading
_
(i.e.hydrotools._restclient
).Following the package name normalization specification, the normalized form of
hydrotools._restclient
ishydrotools-restclient
. This means either the packageshydrotools._restclient
andhydrotools.restclient
are indistinguishable or pypi no longer allows namespace package names with leading_
s.Because of this, I cannot upload a new version of my package.
Expected behavior
Package uploads without error.
To Reproduce
_
in package name (not namespace name). For example,namespace._package
.python -m build
build==1.0.3
producesdist/namespace._package-0.0.1-py3-none-any.whl
anddist/namespace._package-0.0.1.tar.gz
.twine upload dist/*
results in:My Platform
Additional context
It seems that PEP 503's normalized names specification differs from package names that were once allowable by PyPI.
The text was updated successfully, but these errors were encountered: