From 71c57f4ab79ffe442630fdd53f11740e0db2752e Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 29 Mar 2024 12:32:48 +0100 Subject: [PATCH] Support script for retrieving package version --- Makefile | 6 ++++-- print-package-version | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 print-package-version diff --git a/Makefile b/Makefile index f848d57..d66e17b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/print-package-version b/print-package-version new file mode 100755 index 0000000..40d63d2 --- /dev/null +++ b/print-package-version @@ -0,0 +1,5 @@ +#!/bin/sh +cd "$(dirname "$0")" +. ./.envrc +exec python -c \ + 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])'