-
Notifications
You must be signed in to change notification settings - Fork 308
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
"410 Client Error: This API is no longer supported" during twine register
#200
Comments
Twine 1.7 switched the default PyPI URL to pypi.io. This is the next generation of PyPI and far more reliable and stable than pypi.python.org currently is. On the new version of PyPI, register is unnecessary. @dstufft can explain in more detail |
Ah, got it. Maybe we could update the server's message to include some of that text.. "With pypi.io, the 'register' API is no longer necessary: please just use 'upload' instead", and maybe with a URL that points to a longer explanation? I could work on a patch for that. What's the repo for the server codebase? |
Yea, though perhaps we should just continue to allow registration separately, even if it's not needed. |
@dstufft did warehouse address this or no? Should I fix this for twine's next release? |
This has not yet changed in Warehouse. To be honest I forgot about it. |
No worries. @dstufft would it help if I sent a PR to warehouse to implement this? |
Sure! It'd be in |
I also hit this: $ twine --version
twine version 1.8.1 (pkginfo: 1.4.1, requests: 2.12.4, setuptools: 32.3.1,
requests-toolbelt: 0.7.0, clint: 0.5.1)
$ twine register dist/mypackage-1.7.0.tar.gz
Registering package to https://upload.pypi.org/legacy/
Registering mypackage-1.7.0.tar.gz
HTTPError: 410 Client Error: This API is no longer supported, instead simply upload the file. for url: https://upload.pypi.org/legacy/
$ twine upload dist/mypackage-1.7.0.tar.gz
Uploading distributions to https://upload.pypi.org/legacy/
Uploading mypackage-1.7.0.tar.gz
[================================] 46592/46592 - 00:00:03 There are two places that say to register with twine: There's a stalled PR to update the former: pypa/packaging.python.org#271 It'd be great to update the latter too, to say what "if necessary" actually means. |
OK, problem: I tried to register, and got the 410 error telling me to just upload. So, I run upload, and get a 403 Client Error: you are not allowed to upload. Of course, in the twine README (usage, above) it says: If you see the following error while uploading to PyPI, it probably means you need to register (see step 2): $ HTTPError: 403 Client Error: You are not allowed to edit 'xyz' package information SO, how, exactly, is one supposed to upload a new package (brand new, never been distributed before) these days? I have .pypirc pointed at upload.pypi.org/legacy/. AND, I can't test it on testpypi, because it uses the Django 1.10 framework classifier, which is NOT on testpypi, but is on production... |
I'm following this tutorial: https://python-packaging.readthedocs.io/en/latest/minimal.html Needless to say, I need some advice on how to proceed here. Why would they shut off the legacy upload system with no explanation or information? edit: https://packaging.python.org/distributing/#working-in-development-mode That tutorial works for me. Not sure where the older one comes from. |
I also am lost. How do I register and upload on PyPI? |
@mcarans Just upload your package, register is not required any longer. |
Registering works on testpypi but not on the real pypi. Registering is useful if one is not able to upload the package (eg larger than PyPI's size limit), or is third-party hosting not supported on PyPI any more? |
@lanshark if I understand correctly your comment about testing with testpypi as uploading to testpypi and then installing using
For uploading a package for the first time, I believe that you need to first register it on PyPI, either with |
@johnyf ah, I see. Bummer. Thanks for the pointer |
@johnyf The problem with testing on testpypi is that the classifiers accepted in production and on testpypi are not the same. Specifically, django::1.10 is not defined on testpypi, but is defined on pypi. I would assume same for 1.11.. Those classifiers need to be kept in sync. |
No longer necessary / possible pypa/twine#200
I'm following all the instructions for uploading to pypi and running into this error too (instructions from here: https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi). I dunno what to say other than to just echo sentiment that this is super confusing and a huge hurdle for publishing python packages. Shouldn't 'twine upload dist/*' just work? I dunno what is going wrong here, I'm not choosing some legacy endpoint and am using the latest twine 1.9.1 version:
Just posting this comment as venting/frustration that this is much, much harder and confusing than it should be IMHO. Not sure how to fix it... edit: So here's the magic incantation to fix it for folks that run into this and are as completely perplexed as I was: #270 The key is to comment out any [repository] setting you had in .pypirc. After doing that it seems to work and upload again. It would be really, really nice for twine to catch this case and give an actionable error since previous packaging instructions told people to add that repository line, etc. |
Thank you @tdicola, after removing .pypirc file it finally worked! |
This is horrible. As @tdicola suggests, the fatal error that It used to work. It no longer works. Error messages are non-human-readable. Further confirmation that the Python packaging ecosystem remains fundamentally broken. |
Oh. Right. It's 5:15AM on a bitter December morning, which means I'm stupid. For the comment-tolerant, here's mine (excluding authentication tokens, obviously):
And that's how the cheeseshop was won. Incidentally, this is why you do not break longstanding API URLs. Lookin' at you, PyPI. |
For some reason, PyPi broke for a while and I had everything configured correctly. When it broke, (I did not know) it gave me the deprecation message and I was under the impressions it was necessary to configure the repo URL. It is not. I can confirm @leycec solution. |
Thanks to @tdicola and others who have commented here and shared bug reports. The newly improved Migrating to PyPI.org guide talks about the need to remove the Thank you again and I'm sorry for the trouble. |
I upgraded to twine-1.7.4, then did a
twine register dist/foolscap-0.12.0.tar.gz
, and got the following error message:I couldn't really figure out what I was doing wrong, so I downgraded to the twine-1.6.5 I'd had previously, and then
twine register
andtwine upload
worked fine.Is this user error, or something internal going wrong?
The text was updated successfully, but these errors were encountered: