-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.PHONY: docs # The docs directory already exists
all: format test
POETRY_CMD:=rp # Relaxed poetry
CMD:=$(POETRY_CMD) run python -m
format: ## Runs black and isort
$(CMD) isort .
$(CMD) black .
test: pytest type-checking lint dependencies ## Runs all available tests (pytest, type checking, etc.)
install: install-pytest install-type-checking install-dependencies install-lint
pytest: ## Runs pytest on the tests folder and outputs coverage.xml
$(CMD) pytest --cov-report=xml:coverage.xml --cov=depythel_api/depythel --cov=depythel_clt depythel_api/tests tests
install-pytest:
$(CMD) pip install pytest pytest-cov pytest-mock
type-checking: ## Runs mypy --strict
$(CMD) mypy --strict depythel_api depythel_clt tests
install-type-checking: # pytest required for mypy of test files
$(CMD) pip install mypy==0.931 pytest pytest-mock
dependencies: ## Verifies pyproject.toml file integrity
$(POETRY_CMD) check
$(CMD) pip check
install-dependencies: ## Don't install anything
@:
lint: ## Tests whether formatting meets standards
$(CMD) black --check .
$(CMD) isort --check-only .
$(CMD) pydocstyle --convention=google .
install-lint:
$(CMD) pip install black isort pydocstyle