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?
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)
I previously had no repository specified so was using the default
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.
Bumped into the same issue. The default needs to be updated.
UPD: Actually, my .pypirc had repository URL, withdrawn.
Turns out I was using an old twine version kicking around in my system, instead of the one I had just installed - withdrawn.
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.
I had a similar issue and I eventually debugged it to having the wrong version of twine...
@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.