Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the new upload URL for the Test PyPI server?

I'm trying to package a new project and upload it to the TestPyPI server. Because of the introduction of the new PyPI.org, virtually all the instructions I've found are out of date, and trying to upload to https://testpypi.python.org/pypi now returns 401 Gone.

The guide for migrating to the new PyPI.org says to use https://test.pypi.org/legacy as the repository for TestPyPI. However, when inserting this URL into my .pypirc file and trying to upload my package, I receive the following error:

python setup.py sdist upload -r testpypi
[...]
running upload
Submitting dist/<package_name> to https://test.pypi.org/legacy
Upload failed (404): Not Found
error: Upload failed (404): Not Found

Here are the contents of my ~/.pypirc file:

[distutils]
index-servers =
  pypi
  testpypi

[pypi]
repository: https://pypi.python.org/pypi
username: your_username
password: your_password

[testpypi]
repository: https://test.pypi.org/legacy
username: pbaranay
password: my_password
like image 738
pbaranay Avatar asked Aug 04 '17 21:08

pbaranay


People also ask

How do I upload a package to test PyPI?

Upload your package to the Test PyPI repositoryLogin to the Test PyPI repository and verify that your package is in there. If so, copy the command that is under the package's name, run it in your command line and, read in your screen the message saying that your package was successfully installed.

How do you test PyPI?

Go to https://test.pypi.org/account/register/ to register your account. The database for TestPyPI may be periodically pruned, so it is not unusual for user accounts to be deleted.


1 Answers

The new URL for the Test PyPI repository is https://test.pypi.org/legacy/ -- note the trailing slash. The migration guide also says to use this URL (with the slash included).

like image 55
pbaranay Avatar answered Sep 20 '22 10:09

pbaranay