Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing tagged commits causes duplicate TestPyPI upload #10

Closed
rpanderson opened this issue May 9, 2020 · 0 comments · Fixed by #11
Closed

Pushing tagged commits causes duplicate TestPyPI upload #10

rpanderson opened this issue May 9, 2020 · 0 comments · Fixed by #11
Assignees
Labels
bug Something isn't working

Comments

@rpanderson
Copy link
Owner

rpanderson commented May 9, 2020

The 'Publish on TestPyPI' step of the release job in .github/workflows/release.yml currently runs for any push to master or stable branches, and tag creation events.

This is fine if tags are added after (or just pushed after) a commit has been pushed, as the version number on TestPyPI resulting from the push event will be, e.g. 0.1.2.dev2, prior to the tag 0.1.2 being set.

If however the commit is tagged and push --tags is used, the same version 0.1.2 (or a release candidate) is used for the build and upload to TestPyPI. The second one fails, of course, as said version already exists on TestPyPI.

One solution to this would be to not run the TestPyPI step when pushing commits unless its an untagged, i.e. development version. This can be determined at build time by checking for dev in the setuptools_scm generated version string.

Another would be to not push tags until after the tagged commit has been pushed, but this is more error-prone and inefficient.

@rpanderson rpanderson added the bug Something isn't working label May 9, 2020
@rpanderson rpanderson self-assigned this May 9, 2020
rpanderson added a commit that referenced this issue May 9, 2020
... but not both as this triggers a duplicate upload. Resolves #10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant