gerbonara/Makefile

46 wiersze
1.2 KiB
Makefile

2023-03-23 12:13:35 +00:00
PYTHON ?= python
PYTEST ?= pytest
SPHINX_BUILD ?= sphinx-build
2021-05-23 11:42:45 +00:00
2023-03-23 12:13:35 +00:00
.DEFAULT_GOAL := help
.PHONY: clean docs test test-coverage install sdist bdist_wheel upload testupload help
2022-02-01 21:08:54 +00:00
all: docs sdist bdist_wheel
2021-05-23 11:42:45 +00:00
2023-03-23 12:13:35 +00:00
clean: ## Clean up project directory
find . -name '*.pyc' -delete
rm -rf *.egg-info
2019-11-27 02:24:18 +00:00
rm -f .coverage
rm -f coverage.xml
2022-02-01 21:08:54 +00:00
rm -rf docs/_build
2023-03-23 12:13:35 +00:00
docs: ## Generate documentation
2022-02-01 21:08:54 +00:00
sphinx-build -E docs docs/_build
2021-05-23 11:42:45 +00:00
2023-03-23 12:13:35 +00:00
test: ## Run tests
$(PYTEST)
2023-03-23 12:13:35 +00:00
test-coverage: ## Generate coverage
2019-11-27 02:24:18 +00:00
rm -f .coverage
rm -f coverage.xml
$(PYTEST) --cov=./ --cov-report=xml
2023-03-23 12:13:35 +00:00
install: ## Install locally
PYTHONPATH=. $(PYTHON) setup.py install
2021-05-23 11:42:45 +00:00
2023-03-23 12:13:35 +00:00
sdist: ## Build source distribution
2021-05-23 11:42:45 +00:00
python3 setup.py sdist
2023-03-23 12:13:35 +00:00
bdist_wheel: ## Build binary distribution
2021-05-23 11:42:45 +00:00
python3 setup.py bdist_wheel
2023-03-23 12:13:35 +00:00
upload: sdist bdist_wheel ## Upload Python package to PyPI
2022-02-01 21:08:54 +00:00
twine upload -s -i gerbonara@jaseg.de --config-file ~/.pypirc --skip-existing --repository pypi dist/*
2021-05-23 11:42:45 +00:00
2023-03-23 12:13:35 +00:00
testupload: sdist bdist_wheel ## Upload Python package to test PyPI
2021-05-23 11:42:45 +00:00
twine upload --config-file ~/.pypirc --skip-existing --repository testpypi dist/*
2014-09-29 01:17:13 +00:00
2023-03-23 12:13:35 +00:00
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}'