poetry: Upload to TestPyPI silently failed.
- [x ] I am on the latest Poetry version.
- [x ] I have searched the issues of this repo and believe that this is not a duplicate.
- [x ] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Mac OSX 10.14.2
- Poetry version: 0.12.10
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/kk6/47980a543bc3f249f2bbe1d91660610d
Issue
I tried uploading the test package to TestPyPI using Poetry.
~/s/kk6-demo $ poetry config repositories.testpypi https://test.pypi.org/simple
~/s/kk6-demo $ poetry publish -r testpypi
Publishing kk6-demo (0.1.0) to testpypi
Username: kk6
Password:
- Uploading kk6-demo-0.1.0.tar.gz 100%
- Uploading kk6_demo-0.1.0-py3-none-any.whl 100%
As far as looking at the output, the upload seems to be successful. However, when I look at TestPyPI’s own project list, I can not find the package I uploaded earlier.
So, trying uploading in the same way using twine
as a test, HTTPError: 400 Client Error
returned.
~/s/kk6-demo $ poetry run twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Enter your username: kk6
Enter your password:
Uploading distributions to https://test.pypi.org/legacy/
Uploading kk6_demo-0.1.0-py3-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████| 3.77k/3.77k [00:01<00:00, 2.36kB/s]
Uploading kk6_demo-0.1.1-py3-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████| 3.77k/3.77k [00:01<00:00, 3.13kB/s]
Uploading kk6-demo-0.1.0.tar.gz
100%|██████████████████████████████████████████████████████████████████████████████| 3.49k/3.49k [00:00<00:00, 9.05kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Client Error: 'None' is an invalid value for Home-Page. Error: Invalid URI See https://packaging.python.org/specifications/core-metadata for url: https://test.pypi.org/legacy/
It seems to be caused by not setting the homepage, so I added the following settings to pyproject.toml.
[tool.poetry]
...
homepage = "https://github.com/kk6/kk6-demo"
When I tried uploading again with Poetry, I succeeded this time.
~/s/kk6-demo $ poetry config repositories.testpypi https://test.pypi.org/legacy/
~/s/kk6-demo $ poetry publish -r testpypi
Publishing kk6-demo (0.1.0) to testpypi
Username: kk6
Password:
- Uploading kk6-demo-0.1.0.tar.gz 100%
- Uploading kk6_demo-0.1.0-py3-none-any.whl 100%
This time it was added to https://test.pypi.org/manage/projects/ properly.
If homepage is not set in pyproject.toml
, I think that Poetry probably received HTTPError: 400 Client Error
, but in that case I thought that should be displayed.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 16 (6 by maintainers)
Commits related to this issue
- Fix error reporting when publishing fails Adresses #742 and #239 — committed to python-poetry/poetry by sdispater 5 years ago
Thanks @brentspector, adding the trailing slash in the config works for me.
Using this fails silently:
Adding the slash works, and the package becomes available on testpypi:
In both cases the output is identical.
This bug seems to still be here
using the
-v
flag doesn’t help:While uploading to TestPypi,
poetry publish
showed that it successfully uploaded, but I was unable to find it on the site. It turns out that it was getting a 301 because I missed the trailing/
that it needed. Using-vvv
did not return any helpful information for troubleshooting. I recommend the following.I am experiencing the bug in Poetry 1.0.3
This issue with the
publish
command should be fixed in commit 903514060748496f9c87513ba7fb33ed29158325. It will be released in the next bugfix version.I think the doc should use https://test.pypi.org/simple/ instead of https://foo.bar/simple/ which feels like a fake URL.
I noticed similar behavior against devpi-server. My mistake was to use
url = "https://<internal server url>/kristofferb/dev/simple+/"
. Usinghttps://<internal server url>/kristofferb/dev/
instead fixed this.I found by looking at the server log that the server responded with a 200 http code:
Using the correct URL, the log indicates that the server responds with a 200 http code: