Support script for retrieving package version

This commit is contained in:
Tony Garnock-Jones 2024-03-29 12:32:48 +01:00
parent 1b72f71a32
commit 71c57f4ab7
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
PACKAGEVERSION := $(shell python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
PACKAGEVERSION := $(shell ./print-package-version)
all:
@ -14,7 +14,9 @@ tag:
publish: clean build
twine upload dist/*
build: dist/syndicate-py-$(PACKAGEVERSION).tar.gz
build: build-only
build-only: dist/syndicate-py-$(PACKAGEVERSION).tar.gz
dist/syndicate-py-$(PACKAGEVERSION).tar.gz:
python3 -m build

5
print-package-version Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
cd "$(dirname "$0")"
. ./.envrc
exec python -c \
'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])'