summaryrefslogtreecommitdiff
path: root/Makefile
blob: 228dc27b428a50bf2dea96391262f5d67e546927 (plain)
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
38
39
40
41
42
43
44
45
PYTHON ?= python
PYTEST ?= pytest
SPHINX_BUILD ?= sphinx-build

.DEFAULT_GOAL := help

.PHONY: clean docs test test-coverage install sdist bdist_wheel upload testupload help

all: docs sdist bdist_wheel

clean:  ## Clean up project directory
	find . -name '*.pyc' -delete
	rm -rf *.egg-info
	rm -f .coverage
	rm -f coverage.xml
	rm -rf docs/_build

docs:  ## Generate documentation
	sphinx-build -E docs docs/_build

test:  ## Run tests
	$(PYTEST)

test-coverage:  ## Generate coverage
	rm -f .coverage
	rm -f coverage.xml
	$(PYTEST) --cov=./ --cov-report=xml 

install:  ## Install locally
	PYTHONPATH=. $(PYTHON) setup.py install

sdist:  ## Build source distribution
	python3 setup.py sdist

bdist_wheel:  ## Build binary distribution
	python3 setup.py bdist_wheel

upload: sdist bdist_wheel  ## Upload Python package to PyPI
	twine upload -s -i gerbonara@jaseg.de --config-file ~/.pypirc --skip-existing --repository pypi dist/*

testupload: sdist bdist_wheel  ## Upload Python package to test PyPI
	twine upload --config-file ~/.pypirc --skip-existing --repository testpypi dist/*

help:  ## Display this help
	@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'