File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,19 @@ jobs:
197197 export PYTHONPATH="$(pwd)/src${PYTHONPATH:+:$PYTHONPATH}"
198198 python -m pytest tests/functional_tests/ --color=yes -n auto
199199
200+ # Ensures a consistent high version like 999.0.0 when not on a tagged commit
201+ # This is needed for testing the package in the next job, as its version
202+ # must be higher than the PyPI version for pip to prefer the local version.
203+ - name : Inject fallback version tag if not on a real tag
204+ shell : bash
205+ run : |
206+ if ! git describe --tags --match "v*" --exact-match > /dev/null 2>&1; then
207+ echo "Not on release tag — applying fallback 'v999.0.0'"
208+ git tag v999.0.0
209+ else
210+ echo "On a valid tag"
211+ fi
212+
200213 - name : Create Python package for the next job
201214 shell : bash
202215 run : python -m build --wheel --outdir dist
Original file line number Diff line number Diff line change @@ -104,12 +104,6 @@ allow-direct-references = true
104104[tool .hatch .version ]
105105source = ' versioningit' # Use versioningit to manage the version
106106
107- # Override the version used specifically during build time (e.g., in CI)
108- # - Ensures a consistent high version like 999.0.0 when not on a tagged commit
109- [tool .hatch .build .hooks .versioningit-onbuild ]
110- method = ' literal'
111- version = ' 999.0.0'
112-
113107# ###############################
114108# Configuration for versioningit
115109# ###############################
You can’t perform that action at this time.
0 commit comments