diff options
author | Nico Schlömer <nico.schloemer@gmail.com> | 2020-07-20 11:16:01 +0200 |
---|---|---|
committer | Nico Schlömer <nico.schloemer@gmail.com> | 2020-07-20 11:16:01 +0200 |
commit | 3e98283d58dc8874ea2408bbde05ffcc5636a353 (patch) | |
tree | 6328886227cd4f635967f02374a1b16a5cc775c5 /Makefile | |
parent | 536d9f47196a9d988d31ef9701bf8dd3090f6f16 (diff) | |
download | autotiling-3e98283d58dc8874ea2408bbde05ffcc5636a353.tar.gz |
add Makefile
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..aecacf2 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +VERSION=$(shell python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])") + +default: + @echo "\"make publish\"?" + +upload: + # Make sure we're on the master branch + @if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]; then exit 1; fi + rm -f dist/* + # https://stackoverflow.com/a/58756491/353337 + python3 -m pep517.build --source --binary . + twine upload dist/* + +tag: + @if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]; then exit 1; fi + curl -H "Authorization: token `cat $(HOME)/.github-access-token`" -d '{"tag_name": "v$(VERSION)"}' https://api.github.com/repos/nwg-piotr/autotiling/releases + +publish: tag upload + +clean: + @find . | grep -E "(__pycache__|\.pyc|\.pyo$\)" | xargs rm -rf + @rm -rf *.egg-info/ build/ dist/ MANIFEST + +format: + isort . + black . + +black: + black . + +lint: + black --check . + flake8 . |