Skip to content

Commit e20c0b5

Browse files
authored
Merge pull request #684 from will-moore/publish_pypi_syntax_fix
Fix PKG_VERSION fix in publish_pypi.yml
2 parents bef4aaa + f83aee7 commit e20c0b5

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

.github/workflows/publish_pypi.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,6 @@ jobs:
1111
- uses: actions/setup-python@v5
1212
with:
1313
python-version: '3.10'
14-
- name: Validate tag matches package version
15-
if: startsWith(github.ref, 'refs/tags')
16-
run: |
17-
TAG="${GITHUB_REF#refs/tags/}"
18-
# Allow either 1.2.3.rc1 or v1.2.3.rc1 tags.
19-
TAG_NO_V="${TAG#v}"
20-
PKG_VERSION="$(python -c \"import omero_figure.utils as u; print(u.__version__)\")"
21-
22-
echo "Tag: ${TAG}"
23-
echo "Package version: ${PKG_VERSION}"
24-
25-
# Compare normalized PEP 440 versions so 1.2.3.rc1 and 1.2.3rc1 are equivalent.
26-
python - <<'PY'
27-
import os
28-
import sys
29-
30-
from packaging.version import Version
31-
32-
tag = os.environ["TAG_NO_V"]
33-
pkg = os.environ["PKG_VERSION"]
34-
tag_v = Version(tag)
35-
pkg_v = Version(pkg)
36-
37-
if tag_v != pkg_v:
38-
print(f"ERROR: Tag ({tag}) does not match package version ({pkg}).")
39-
print(f"Normalized tag={tag_v}, package={pkg_v}")
40-
sys.exit(1)
41-
42-
print(f"Validated normalized version match: {tag_v}")
43-
PY
4414
- name: Build a binary wheel and a source tarball
4515
run: |
4616
python -mpip install build

0 commit comments

Comments
 (0)