preserves/implementations/python/Makefile

41 lines
916 B
Makefile
Raw Normal View History

2023-11-10 16:38:10 +00:00
# This used to just be
# PACKAGEVERSION := "`python3 setup.py --version`"
PACKAGEVERSION := "`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
2022-01-13 22:29:47 +00:00
test: update-test-data
python3 -m unittest discover -s tests
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
python3-coverage run --branch -m unittest discover -s tests
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
#
# 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-03-17 08:07:53 +00:00
build: build-docs
2021-11-30 17:41:34 +00:00
python3 setup.py sdist bdist_wheel