pypa / twine

Utilities for interacting with PyPI
https://twine.readthedocs.io/
Apache License 2.0
1.61k stars 308 forks source link

Can't upload to PyPI: 410 Client Error #276

Closed anentropic closed 6 years ago

anentropic commented 7 years ago

I have updated to twine==1.9.1 and I run as:
twine upload --config-file=.pypirc dist/*

I get this error:

HTTPError: 410 Client Error: Gone (This API has been deprecated and removed from legacy PyPI in favor of using the APIs available in the new PyPI.org implementation of PyPI (located at https://pypi.org/). For more information about migrating your use of this API to PyPI.org, please see https://packaging.python.org/guides/migrating-to-pypi-org/#uploading. For more information about the sunsetting of this API, please see https://mail.python.org/pipermail/distutils-sig/2017-June/030766.html)

I was able to workaround by adding:

[pypi]
repository:https://upload.pypi.org/legacy/

to my .pypirc file

The url mentioned in the error says that this should not be necessary if using latest version of twine. Is this wrong?

sigmavirus24 commented 7 years ago

If your pypirc previously specified a different URL, we don't forcibly override this if I remember correctly. That may need to change (if and only if we detect the old URL)

anentropic commented 7 years ago

I previously had no repository specified so was using the default

spookylukey commented 6 years ago

I also am using default options (nothing in my .pypirc about repository), and it fails with this error.

This ought to be a high priority. AFAICS out of the box, twine does not do the one thing it is supposed to do, namely upload packages for publishing on PyPI.

arcivanov commented 6 years ago

Bumped into the same issue. The default needs to be updated. UPD: Actually, my .pypirc had repository URL, withdrawn.

spookylukey commented 6 years ago

Turns out I was using an old twine version kicking around in my system, instead of the one I had just installed - withdrawn.

gene1wood commented 6 years ago

I had to change my ~/.pypirc from this

[pypi]
repository: https://pypi.python.org/pypi
username: jdoe

[pypitest]
repository: https://testpypi.python.org/pypi
username: jdoe

to this

[pypi]
repository: https://upload.pypi.org/legacy/
username: jdoe

[pypitest]
repository: https://test.pypi.org/legacy/
username: jdoe

Which resolved this problem for me.

gnulnx commented 6 years ago

I had a similar issue and I eventually debugged it to having the wrong version of twine...

https://github.com/pypa/twine/issues/291

brainwane commented 6 years ago

@anentropic I have just released Twine version 1.11.0 and I think your problem should now be resolved. Thanks for reporting it, and thanks everyone here for sharing their reports!

For reference, here is the documentation on .pypirc file formats -- I'm pretty sure that having a .pypirc file that follows that format will work best and avoid edge cases in the future, with twine and other tools.

STAR-811 commented 2 years ago

[pypitest] repository: https://test.pypi.org/legacy/ username: jdoe

It really helps!