Skip to content

Commit 104f41a

Browse files
committed
Add Python package semantic version check to Makefile
`$ make check-versions` will verify that the root Python module of each package has a valid semantic version. This is part of the larger effort to build the PyPI package publishing workflow.
1 parent c9ee112 commit 104f41a

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default: test-all
55
uv-sync:
66
@uv sync --all-packages 2> /dev/null
77

8-
check: test doctest
8+
check: test doctest check-versions
99
@uv run ruff check -q packages/
1010
@$(MAKE) mypy
1111
@uv run ruff format --check packages/
@@ -45,5 +45,12 @@ mypy: uv-sync
4545
| xargs uv run mypy --no-error-summary
4646
@uv run mypy --no-error-summary packages/*/tests/*.py
4747

48+
check-versions:
49+
@find packages -maxdepth 1 -type d -name "overture-schema*" \
50+
| sort \
51+
| tr - . \
52+
| sed 's|^packages/||' \
53+
| xargs uv run python -c 'import semver, sys; from importlib import metadata; [print(m, semver.VersionInfo.parse(metadata.version(m))) for m in sys.argv[1:]]'
54+
4855
reset-baseline-schemas:
4956
@find . -name \*_baseline_schema.json -delete

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ dev = [
5353
"pytest>=8.4.1",
5454
"pytest-cov>=7.0.0",
5555
"ruff>=0.12.4",
56+
"semver>=3.0.4"
5657
]
5758

5859
[tool.pytest.ini_options]

uv.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)