Debian Codegraph @

Makefile

raw symbols SCIP
1 .ONESHELL:
2 .SHELLFLAGS = -ec
3 .SILENT:
4 version := $(shell python -c "import tomllib;print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
5
6 .PHONY: dist
7 dist:
8 python -m build
9
10 .PHONY: release
11 release: lock dist
12 # check that changelog is updated. only look at first 3 parts of semver
13 version=$(version)
14 stripped=$$(echo $${version} | cut -d . -f -3 | cut -d '-' -f 1)
15 if ! grep $${stripped} CHANGELOG.rst
16 then
17 echo "Changelog doesn't seem to be updated! Quitting..."
18 exit 1
19 fi
20 # generate release notes from changelog
21 awk "BEGIN{p=0}; /^$${stripped}/{next}; /---/{p=1;next}; /^$$/{exit}; p {print}" CHANGELOG.rst > TMPNOTES
22 # make github and pypi release
23 gh release create --latest --verify-tag v$(version) dist/pykeepass-$(version)* -F TMPNOTES
24 twine upload -u __token__ dist/pykeepass-$(version)*
25
26 .PHONY: lock
27 lock:
28 # run tests then make a requirements.txt lockfile
29 rm -rf .venv_lock
30 virtualenv .venv_lock
31 . .venv_lock/bin/activate
32 pip install .[test]
33 python tests/tests.py
34 pip freeze > requirements.txt
35
36 .PHONY: tag
37 tag:
38 # tag git commit
39 git add requirements.txt
40 git add pyproject.toml
41 git add CHANGELOG.rst
42 git commit -m "bump version" --allow-empty
43 git tag -a v$(version) -m "version $(version)"
44 git push --tags
45 git push
46
47 .PHONY: docs
48 docs:
49 pdoc -o docs --docformat google --no-search pykeepass '!pykeepass.icons' --footer-text "pykeepass ${version}"
50 ghp-import -f -p -b docs docs