This repository has been archived on 2026-02-22. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
config-skeleton/Makefile
Jef Roosens e044c07cd6
Some checks failed
continuous-integration/drone the build failed
Added isort config; linter now checks tests
2021-05-22 18:41:57 +02:00

51 lines
943 B
Makefile

# =====CONFIG=====
PYTHON := python3
# This can't contain spaces (I think)
VENV := .venv
# Minimum % coverage for tests to succeed
MIN_COV := 50
SRC := setup.py app tests
# =====GENERAL=====
## By default, create the venv
all: venv
.PHONY: all
## Remove any temporary files
clean:
@ rm -rf '$(VENV)'
.PHONY: clean
# =====BACKEND=====
## VENV
### Create the venv
$(VENV)/bin/activate: setup.cfg
@ '$(PYTHON)' -m venv '$(VENV)'
@ '$(VENV)'/bin/pip install -e .[develop]
### Convenient alias for the venv
venv: $(VENV)/bin/activate
.PHONY: venv
## Formatting & linting
### Format the codebase using black
format: venv
@ '$(VENV)'/bin/black $(SRC)
@ '$(VENV)'/bin/isort $(SRC)
.PHONY: format
### Lint using black & flake8
lint: venv
@ '$(VENV)'/bin/flake8 $(SRC)
@ '$(VENV)'/bin/black --check $(SRC)
.PHONY: lint
## Testing
test: venv
@ '$(VENV)'/bin/pytest --cov=app --cov-fail-under='$(MIN_COV)' tests/
.PHONY: test