Skip to content

Commit ba81154

Browse files
committed
CI: Ignore version duplicates on publication to TestPyPI
This commit prevents the failure of the GitHub Actions job "Publish distribution package to TestPyPI" on most pushes (see discussion at #721 (comment)), since recent commit a3e1325 "CI: Publish PyPI releases using GitHub Actions workflows". Indeed, TestPyPI doesn't allow repushing the same version. Use `skip-existing` to prevent to such failures on the CI. An alternative would be to use the `setuptools-scm` plugin, but it requires more changes (to define the version in `pyproject.toml`, to fetch tags from GitHub in `publish.yaml`, and to exclude `.*` + `.github/**` files in `MANIFEST.in`). Moreover it doesn't work as is: to prevent errors like `HTTP 400 The use of local versions in '1.36.2.dev2+gd4f1c14' we would need `local_scheme = "no-local-version"`, which would push duplicated version on TestPyPI anyway.
1 parent 16727ac commit ba81154

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
uses: pypa/gh-action-pypi-publish@release/v1
4747
with:
4848
repository-url: https://test.pypi.org/legacy/
49+
skip-existing: true
4950

5051
publish-to-pypi:
5152
name: Publish distribution package to PyPI

0 commit comments

Comments
 (0)