poetry can't upload but twine works
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- Ubuntu 18.04:
- Poetry version 1.0.3:
- Link of a Gist with the contents of your pyproject.toml file: https://github.com/jedie/poetry-publish/blob/master/pyproject.toml
Issue
Poetry gets 403: Invalid or non-existent authentication information
but twine can upload correctly:
Upload to PyPi via poetry:
Call: 'poetry publish -vvv'
Publishing poetry-publish (0.3.0.rc3) to PyPI
Found an API token for pypi.
- Uploading poetry-publish-0.3.0rc3.tar.gz 100%
[UploadError]
HTTP Error 403: Invalid or non-existent authentication information.
Traceback (most recent call last):
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/home/jens/.poetry/lib/poetry/console/commands/publish.py", line 81, in handle
client_cert,
File "/home/jens/.poetry/lib/poetry/masonry/publishing/publisher.py", line 96, in publish
client_cert=resolved_client_cert,
File "/home/jens/.poetry/lib/poetry/masonry/publishing/uploader.py", line 110, in upload
self._upload(session, url)
File "/home/jens/.poetry/lib/poetry/masonry/publishing/uploader.py", line 205, in _upload
raise UploadError(e)
Poetry publish error -> fallback and use twine
Call: 'poetry run twine upload dist/*.*'
Uploading distributions to https://upload.pypi.org/legacy/
Uploading poetry_publish-0.3.0rc3-py3-none-any.whl
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 34.8k/34.8k [00:02<00:00, 16.2kB/s]
Uploading poetry-publish-0.3.0rc3.tar.gz
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 35.2k/35.2k [00:01<00:00, 27.9kB/s]
View at:
https://pypi.org/project/poetry-publish/0.3.0rc3/
Another error output with PyPi βFile already existsβ: twine get the 400 and reports the right error: poetry gets 403
Call: 'poetry publish -vvv'
Publishing poetry-publish (0.3.0.rc2) to PyPI
Found an API token for pypi.
- Uploading poetry-publish-0.3.0rc2.tar.gz 100%
[UploadError]
HTTP Error 403: Invalid or non-existent authentication information.
Traceback (most recent call last):
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/home/jens/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/home/jens/.poetry/lib/poetry/console/commands/publish.py", line 81, in handle
client_cert,
File "/home/jens/.poetry/lib/poetry/masonry/publishing/publisher.py", line 96, in publish
client_cert=resolved_client_cert,
File "/home/jens/.poetry/lib/poetry/masonry/publishing/uploader.py", line 110, in upload
self._upload(session, url)
File "/home/jens/.poetry/lib/poetry/masonry/publishing/uploader.py", line 205, in _upload
raise UploadError(e)
Poetry publish error -> fallback and use twine
Call: 'poetry run twine upload dist/*.*'
Uploading distributions to https://upload.pypi.org/legacy/
Uploading poetry_publish-0.3.0rc2-py3-none-any.whl
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 34.8k/34.8k [00:01<00:00, 26.4kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Client Error: File already exists. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy/
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Commands | Documentation | Poetry - Python dependency ...
Commands You've already learned how to use the command-line interface to do some things. This chapter documents all the available commands.
Read more >How to upload new versions of project to PyPI with twine?
You will need to change the version number to one that you haven't previously uploaded to PyPI. You didn't mention how you're uploading...
Read more >Using CodeArtifact with Poetry - Chariot Solutions
When working with CodeArtifact, there are three terms you should know: A package (aka artifact) is a file stored in the repository. For...
Read more >Packaging in Python: Tools and Formats | by Martin Thoma
Uploading packages is done with twine or poetry. Virtual environments are created with venv or with poetry / pipenv / hatch / conda;...
Read more >poetry-version-plugin 0.1.3 - PyPI
Poetry plugin for dynamically extracting the package version from a ... And it doesn't work in Docker try: import importlib.metadata asΒ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same issue here - weirdly, it did not happen with poetry 1.1, and only started with 1.2.
poetry publish
used to prompt me for username and password, now instead it directly gives:I tried with
-u <username> -p <password>
like @JessicaTegner suggested, but that did not help. My password did indeed have weird characters in it, and changing it solved the problem.Closing as there is no reproduction here and thereβs a wide variety of issues happening. If you have special characters in your password, you will have to escape them appropriately (this is related to your shell and not Poetry).
The best way to avoid this is to follow the docs and use a token as there will be no special characters. Otherwise, set an environmental variable or edit the Poetry auth.toml directly (or just properly escape the
-p
flag/poetry config
value).