Unsure how to use `pypi` and `testpypi` with github actions

Hello Python Experts,

My question will refer to the worflow config here. Which is taken from here with minor modifications. I understand that that there are two ways of publishing:

testpypi: To test releases
pypi: To actually release

To use pypi, I do not trigger publication unless the pushed commit is tagged. In this case the tag is the same as the version of the project. To run testpypi, the commit does not need to be tagged.

Therefore I will push many times and only on the first push testpypi will succeed, because there is no e.g, 0.0.1 version. While in the others it will fail. pypi will succeed always, because It will only run when a new tag is created.

How are we supposed to test releases this way? Because the only time a test happens successfuly is when we are tagging it, but that’s when we are publishing to pypi anyway.

Cheers.

Do not use testpypi to test releases regularly and basically never install anything from there.

Use it to test your release process, once (or again if you change it) and then manually verify that the files are there by going to the corresponding website.

1 Like