Files
api_client/Makefile
Eriks Karls 3856358ccf init
2024-03-07 16:50:15 +02:00

58 lines
1.4 KiB
Makefile

.PHONY: clean clean/build clean/pyc help lint lint/flake8 lint/black lint/isort lint/type test
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
clean: clean/build clean/pyc ## remove all build, test, coverage and Python artifacts
clean/build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean/pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
find . -name '.pytest_cache' -exec rm -fr {} +
build/source:
python -m build --sdist
build/wheel:
python -m build --wheel
build/patch:
bump-my-version
release: clean build/source build/patch
twine upload dist/*
lint/flake8: ## check style with flake8
flake8 src/sdlv_api_client
lint/black: ## check style with black
black src/sdlv_api_client
lint/isort: ## check imports with isort
isort src/sdlv_api_client
lint: lint/isort lint/black lint/flake8 ## check style
test: ## run tests quickly with the default Python
pytest -v