forked from nschloe/meshio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 1.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
VERSION=$(shell python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])")
.PHONY: default tag upload publish clean format lint
default:
@echo "\"make publish\"?"
tag:
@if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
@echo "Tagging release version v$(VERSION)..."
# git tag v$(VERSION)
# git push --tags
# Always create a github "release" right after tagging so it appears on zenodo
curl -H "Authorization: token `cat $(HOME)/.github-access-token`" -d '{"tag_name": "v$(VERSION)"}' https://api.github.com/repos/nschloe/meshio/releases
upload: clean
# Make sure we're on the main branch
@if [ "$(shell git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi
# python3 setup.py sdist bdist_wheel
# https://stackoverflow.com/a/58756491/353337
python3 -m build --sdist --wheel .
twine upload dist/*
publish: tag upload
clean:
@find . | grep -E "(__pycache__|\.pyc|\.pyo$\)" | xargs rm -rf
@rm -rf *.egg-info/ build/ dist/
format:
isort .
black .
blacken-docs README.md
lint:
black --check .
flake8 .