| 1 |
.PHONY: clean-pyc clean-build docs help |
| 2 |
.DEFAULT_GOAL := help |
| 3 |
|
| 4 |
help: |
| 5 |
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}' |
| 6 |
|
| 7 |
install: ## install dependencies |
| 8 |
pip install poetry==1.1.14 |
| 9 |
poetry install --no-root |
| 10 |
|
| 11 |
clean: clean-build clean-pyc clean-cache |
| 12 |
|
| 13 |
clean-build: ## remove build artifacts |
| 14 |
rm -fr build/ |
| 15 |
rm -fr dist/ |
| 16 |
rm -fr *.egg-info |
| 17 |
|
| 18 |
clean-pyc: ## remove Python file artifacts |
| 19 |
find . -name '*.pyc' -exec rm -f {} + |
| 20 |
find . -name '*.pyo' -exec rm -f {} + |
| 21 |
find . -name '*~' -exec rm -f {} + |
| 22 |
|
| 23 |
clean-cache: ## remove .cache and .pytest_cache |
| 24 |
rm -rf .cache |
| 25 |
rm -rf .pytest_cache |
| 26 |
|
| 27 |
lint: ## check style with flake8 |
| 28 |
poetry run flake8 |
| 29 |
|
| 30 |
test: ## run tests quickly with the default Python |
| 31 |
poetry run pytest |
| 32 |
|
| 33 |
test-all: ## run tests on every Python version with tox |
| 34 |
poetry run tox --skip-missing-interpreters |
| 35 |
|
| 36 |
coverage: ## check code coverage quickly with the default Python |
| 37 |
rm -rf htmlcov |
| 38 |
poetry run coverage erase |
| 39 |
poetry run coverage run -m pytest |
| 40 |
poetry run coverage report -m |
| 41 |
poetry run coverage html |
| 42 |
|
| 43 |
docs: ## generate Sphinx HTML documentation, including API docs |
| 44 |
$(MAKE) -C docs clean |
| 45 |
$(MAKE) -C docs html |
| 46 |
|
| 47 |
release: sdist ## package and upload a release |
| 48 |
pipenv run twine upload dist/* |
| 49 |
|
| 50 |
build: clean ## package |
| 51 |
poetry build |
| 52 |
# gpg --detach-sign -a dist/*.tar.gz |
| 53 |
ls -l dist |