question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upload to TestPyPI silently failed.

See original GitHub issue
  • [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).

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
stefsmeetscommented, Apr 6, 2020

Thanks @brentspector, adding the trailing slash in the config works for me.

Using this fails silently:

poetry config repositories.testpypi https://test.pypi.org/legacy
poetry publish -r testpypi

Adding the slash works, and the package becomes available on testpypi:

poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi

In both cases the output is identical.

10reactions
Erawpalassalgcommented, Jan 10, 2020

This bug seems to still be here

>>> subprocess.check_output('poetry --version', shell=True).decode()
'Poetry version 1.0.0\n'
>>> subprocess.check_call('poetry publish -r test-pypi --username erawpalassalg --password PASSWORD', shell=True)

Publishing bli (0.1.0) to test-pypi
 - Uploading bli-0.1.0-py3-none-any.whl 100%
 - Uploading bli-0.1.0.tar.gz 100%
0

using the -v flag doesn’t help:

>>> subprocess.check_call('poetry publish -v -r test-pypi --username erawpalassalg --password PASSWORD', shell=True)

Publishing bli (0.1.0) to test-pypi
 - Uploading bli-0.1.0-py3-none-any.whl 100%
 - Uploading bli-0.1.0.tar.gz 100%
0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload a new release to TestPyPi - Stack Overflow
On stack overflow, I found a post stating that a TestPyPi package cannot be overwritten. However, TestPyPi itself indicates that version releaseΒ ...
Read more >
twine upload - Read the Docs
Upload to Test PyPI and verify things look right: twine upload -r testpypi dist/*. Twine will prompt for your username and password. Upload...
Read more >
PyPi - Object storage upload route for package files - GitLab
Implement workhorse routes to support PyPy package upload (ref gitlab#208746 (closed)). Details. The upload format can be found on the PyPIΒ ...
Read more >
Chapter 14 Creating Packages with Python - Merely Useful
It meant that in times of danger you spent the day sitting very quietly in a building ... In this section we upload...
Read more >
Using TestPyPI - Python Packaging User Guide
You can see if your package has successfully uploaded by navigating to the URL https://test.pypi.org/project/<sampleproject> where sampleproject is the nameΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found