11

TLDR: What to do with the error after deleting project from TestPyPI (test.pypi.org) and want to re-upload using the same project name and version?

Answer: You cannot use the same project name and version after PyPI and TestPyPI switched to Warehouse. Successfully uploaded to TestPyPI after bumping setup.py version from '0.0.1' to '0.0.2'

Why new post: Title of the above entry does not reflect the problem in detail, making it difficult to be found


Description:

I was testing a package I wrote using TestPyPI before releasing it to PyPI. However, I discovered there are some errors when I pip install from test.pypi.org:

pip install -i https://test.pypi.org/simple/ PACKAGE_NAME

Thinking I made mistakes during packaging and wanting to re-upload my package, I removed my package from test.pypi.org using the "Manage" button. enter image description here

However, now when I try to upload my adjusted package like I used to do:

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

I receive the "filename has already been used" error.

HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse for more information.

I followed the link and read:

PyPI does not allow for a filename to be reused, even once a project has been deleted and recreated.

So my questions are:

1. Can I still test the package release on TestPyPI using the same filename? (After all, I am using TestPyPI, not PyPI. Shouldn't I be allowed to reset my TestPyPI workspace to its original state? Isn't this the purpose of using TestPyPI?)

2. Am I using TestPyPI the wrong way (in terms of how to delete a project or what TestPyPI is designed to do)? (I was surprised my project still "exists" after I deleted it, as you can see below. I suspect this is why the filename remains occupied after I deleted the project.)


Figure 1: This is what is displayed after removing the project. It seems the project still exists.

This is what is displayed

Figure 2: This is what happens when you click in. It seems the project does not really exist? Project limbo!

This is what happens when you click in

Sean
  • 713
  • 1
  • 10
  • 28

0 Answers0