2023-11-10 16:38:10 +00:00
|
|
|
# This used to just be
|
|
|
|
# PACKAGEVERSION := "`python3 setup.py --version`"
|
2023-11-10 17:08:10 +00:00
|
|
|
PACKAGEVERSION := $(shell python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
|
2023-03-17 08:07:53 +00:00
|
|
|
|
2023-03-16 20:19:42 +00:00
|
|
|
all: test build-docs
|
|
|
|
|
2023-11-10 17:08:10 +00:00
|
|
|
test-in-docker: build-only
|
|
|
|
docker run --rm -v `pwd`/dist:/dist python /bin/bash -c 'pip install dist/preserves-$(PACKAGEVERSION)*.whl && python -c "import preserves.schema; print(preserves.schema)"'
|
|
|
|
|
2022-01-13 22:29:47 +00:00
|
|
|
test: update-test-data
|
2022-01-07 20:09:45 +00:00
|
|
|
python3 -m unittest discover -s tests
|
2018-11-13 12:38:26 +00:00
|
|
|
|
2023-03-16 20:19:42 +00:00
|
|
|
build-docs:
|
2023-03-17 08:07:53 +00:00
|
|
|
mkdocs build -d ../../python/$(PACKAGEVERSION)
|
|
|
|
./update-doc-versions.sh
|
2023-03-16 20:19:42 +00:00
|
|
|
|
2023-03-16 23:22:24 +00:00
|
|
|
serve-docs:
|
|
|
|
mkdocs serve
|
|
|
|
|
2022-01-13 22:29:47 +00:00
|
|
|
coverage: update-test-data
|
2022-01-07 20:09:45 +00:00
|
|
|
python3-coverage run --branch -m unittest discover -s tests
|
2018-11-13 12:38:26 +00:00
|
|
|
python3-coverage html
|
2018-11-15 06:55:12 +00:00
|
|
|
|
2022-01-13 22:29:47 +00:00
|
|
|
update-test-data:
|
|
|
|
rsync ../../tests/samples.bin ../../tests/samples.pr tests
|
|
|
|
|
2022-02-11 10:57:29 +00:00
|
|
|
tag:
|
2023-03-17 08:07:53 +00:00
|
|
|
git tag python-preserves@$(PACKAGEVERSION)
|
2022-02-11 10:57:29 +00:00
|
|
|
|
2018-11-15 06:55:12 +00:00
|
|
|
clean:
|
|
|
|
rm -rf htmlcov
|
2018-11-15 07:09:35 +00:00
|
|
|
find . -iname __pycache__ -o -iname '*.pyc' | xargs rm -rf
|
2018-11-15 06:55:12 +00:00
|
|
|
rm -f .coverage
|
2018-11-15 07:09:35 +00:00
|
|
|
rm -rf preserves.egg-info build dist
|
|
|
|
|
2022-01-07 20:09:45 +00:00
|
|
|
#
|
|
|
|
# sudo apt install python3-wheel twine
|
|
|
|
#
|
2021-11-30 17:41:34 +00:00
|
|
|
publish: clean build
|
2018-11-15 07:09:35 +00:00
|
|
|
twine upload dist/*
|
2021-11-30 17:41:34 +00:00
|
|
|
|
2023-11-10 17:08:10 +00:00
|
|
|
build: build-docs build-only
|
|
|
|
|
|
|
|
build-only: dist/preserves-$(PACKAGEVERSION).tar.gz
|
|
|
|
|
|
|
|
dist/preserves-$(PACKAGEVERSION).tar.gz:
|
2023-11-10 16:41:58 +00:00
|
|
|
python3 -m build
|