| 1 |
version := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])"` |
| 2 |
|
| 3 |
default: |
| 4 |
@echo "\"make publish\"?" |
| 5 |
|
| 6 |
tag: |
| 7 |
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi |
| 8 |
curl -H "Authorization: token `cat ~/.github-access-token`" -d '{"tag_name": "v{{version}}"}' https://api.github.com/repos/nschloe/pygalmesh/releases |
| 9 |
|
| 10 |
upload: clean |
| 11 |
@if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then exit 1; fi |
| 12 |
python3 -m build --sdist . |
| 13 |
twine upload dist/*.tar.gz |
| 14 |
|
| 15 |
publish: tag upload |
| 16 |
|
| 17 |
clean: |
| 18 |
@find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf |
| 19 |
@rm -rf src/*.egg-info/ build/ dist/ .tox/ pygalmesh.egg-info// |
| 20 |
|
| 21 |
format: |
| 22 |
isort . |
| 23 |
black . |
| 24 |
blacken-docs README.md |
| 25 |
|
| 26 |
lint: |
| 27 |
black --check . |
| 28 |
flake8 setup.py pygalmesh/ test/*.py |