CI and test.pypi.org

Hi.

I am working on an opensource library (https://github.com/jampp/migratron), and I want to upload a package to http://test.pypi.org/ for each PR. So I setup the GitHub actions to do that.

That seems to work when the version a new one, but if the version already exists then it raises an error:

Content received from server:
<html>
 <head>
  <title>400 This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse</title>
 </head>
 <body>
  <h1>400 This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse


 </body>
</html>
HTTPError: 400 Client Error: This filename has already been used, use a different version. See https://test.pypi.org/help/#file-name-reuse for url: https://test.pypi.org/legacy/

I need to upload the package to test.pypi.org (or any PyPi repo for that matters), so the other projects that depend on that library can be installed.

How do you manage CI for a project that has many dependencies, and that they haven’t been uploaded to pypi.org yet?

Thanks,
tzulberti

It seems you have dependants which rely on an unreleased version of your library. You’ll have more control if you lock-in the API between your projects, then implement the packages independently and release as alphas/betas/release-candidates

For development, the best might be to specify the repo as your dependency:

pip install git+https://github.com/jampp/migratron
pip install git+https://github.com/jampp/migratron@abcd123  # useful for PRs
pip install https://github.com/jampp/migratron/archive/master.tar.gz

TestPyPI is the wrong place for what you want to do. It is for testing the package release, not releasing packages for testing. It’s better to host your index instead (or just install the package directly by URL as @EpicWink mentioned).