-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (55 loc) · 1.49 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.PHONY: help
.PHONY: dev
.PHONY: docs
.PHONY: tests
.PHONY: test
.PHONY: tox
.PHONY: hook
.PHONY: lint
.PHONY: migrate
.PHONY: migrations
.PHONY: mypy
.PHONY: Makefile
# Trick to allow passing commands to make
# Use quotes (" ") if command contains flags (-h / --help)
args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
# If command doesn't match, do not throw error
%:
@:
define helptext
Commands:
dev Serve manual testing server
docs Serve mkdocs for development.
tests Run all tests with coverage.
test <name> Run all tests maching the given <name>
tox Run all tests with tox.
hook Install pre-commit hook.
lint Run pre-commit hooks on all files.
migrate Run pre-commit hooks on all files.
migrations Run pre-commit hooks on all files.
mypy Run mypy on all files.
Use quotes (" ") if command contains flags (-h / --help)
endef
export helptext
help:
@echo "$$helptext"
dev:
@poetry run python manage.py runserver localhost:8000
docs:
@poetry run mkdocs serve -a localhost:8080
tests:
@poetry run coverage run -m pytest
test:
@poetry run pytest -k $(call args, "")
tox:
@poetry run tox
hook:
@poetry run pre-commit install
lint:
@poetry run pre-commit run --all-files
migrate:
@poetry run python manage.py migrate
migrations:
@poetry run python manage.py makemigrations
mypy:
@poetry run mypy env_config/