diff --git a/Makefile b/Makefile index e3503a6..46cd0dc 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +.PHONY: all clean venv run format format-check lint mypy test dist reformat dev + +PYTHON := venv/bin/python +PIP := venv/bin/pip + all: run clean: @@ -5,27 +10,32 @@ clean: venv: python3 -m venv venv && \ - venv/bin/pip install --upgrade pip setuptools && \ - venv/bin/pip install --editable ".[dev]" + $(PIP) install --upgrade pip setuptools && \ + $(PIP) install --editable ".[dev]" run: venv venv/bin/flask --app scipaperloader --debug run -format: venv - rm -rf venv - venv/bin/black . && venv/bin/isort . +format: + venv/bin/black . + venv/bin/isort . -format-check: venv - venv/bin/black --check . && venv/bin/isort --check . +format-check: + venv/bin/black --check . + venv/bin/isort --check . -lint: venv +reformat: format lint + +lint: venv/bin/flake8 . -mypy: venv - venv/bin/mypy +mypy: + venv/bin/mypy scipaperloader -test: venv +test: venv/bin/pytest -dist: venv format-check lint mypy test - venv/bin/pip wheel --wheel-dir dist --no-deps . +dist: format-check lint mypy test + $(PIP) wheel --wheel-dir dist --no-deps . + +dev: clean venv