-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
poetry publish
fails for package with .
in its name.
#5782
Comments
According to https://packaging.python.org/en/latest/specifications/binary-distribution-format/#escaping-and-unicode, it seems that the right thing to do for wheels would be to replace Though even if doing so, a bug in warehouse (the backend behind PyPI) may prevent the upload from working: pypi/warehouse#10030. |
It seems as though Poetry attempts to publish |
Once again, I'm not exactly sure how to solve this issue, though. |
We've already got a PR under review that uses the same logic pip does to canonicalize wheel names. |
Oh, I see, thanks! I'm looking forward to it. :) |
Hello, what's the progress on the PR @neersighted? I'm running into the same issue. I'm a bit surprised because on 20th of June (so only two weeks back), I was able to publish a package with But today I get
I don't see any release to |
I just realized that this is an issue with I also confirmed the issue with |
I am still getting this issue with poetry==1.2.0 and poetry-core==1.1.0. |
Situation:
So per this issue, folk who try for un-normalized package names find that poetry normalizes their package name at upload, and they can't upload their source distribution because it has the wrong prefix. Probably the sensible next step is to normalize .tar.gz names in poetry-core (and also make the corresponding change in poetry itself - the uploader class currently expects unnormalized source distributions, because it 'knows' what poetry-core did). That gets to a place where poetry insists on normalization, but at least it is possible to upload sdists. Not planning on doing this myself, no doubt MRs are welcome. |
Last time I checked, there was no accepted PEP formally stating that sdists should be canonicalised, though the closest thing there is to that is this packaging specification which states:
There is PEP 625 about canonicalising the name the same way as for wheels, but it is still in draft. Although PEP or not, it would seem more sensible to canonicalise sdists the same way as Poetry already does for wheels, for better consistency, especially since this (probably) shouldn't be a problem for any tool consuming the sdists. |
Sure, the proposal to canonicalize sdists in the same way as bdists wasn't intended to rule out the possibility of supporting un-canonicalized project names at some later point (nor to rule it in, come to that!). I suggest sdist canonicalization as a relatively low risk next step that can be taken without getting into that discussion at all. It's clearly a bug at the moment that some packages can't upload their sdists, start by solving that. Then later debate the merits or otherwise of supporting un-canonicalized names. |
If anything this bug is PyPI being too strict in validation when different names are allowed by the spec -- technically Poetry is doing nothing wrong. However, from a practical standpoint I believe they use filenames to identify releases, so the requirement to match makes sense (even if it's undocumented/not required by spec). |
Is there some way to opt out of the package name normalization or would it be possible to provide such an option? We are using some internal PyPI so I'm not sure if those PyPI validations even affect us. |
No. You will either need to put together an MR changing the code, or hope that someone else does. |
What worked for me is to pin [build-system]
requires = ["poetry-core==1.0.8"]
build-backend = "poetry.core.masonry.api" But I build with |
This will not work with |
Closing as python-poetry/poetry-core#484 is merged. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: windows 11, also fails on linux
Poetry version: 1.2.0-beta.1
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/nekitdev/99b0cd36e9fd32712f38401439823cc1
Issue
For packages with
.
in the name:Poetry correctly builds wheels and sdists with
example.py
in the file name.However, when uploading to PyPI with the canonical name (i.e.
example-py
),poetry publish
fails with the following error:The text was updated successfully, but these errors were encountered: