-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (52 loc) · 1.48 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
export DJANGO_SETTINGS_MODULE = example_project.project.settings
.PHONY: help
.PHONY: dev
.PHONY: docs
.PHONY: tests
.PHONY: test
.PHONY: tox
.PHONY: hook
.PHONY: migrate
.PHONY: migrations
.PHONY: lint
.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 migrations.
migrations Create migrations.
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 -vv -s --log-cli-level=INFO
test:
@poetry run pytest -s -vv --log-cli-level=INFO -k $(call args, "")
tox:
@poetry run tox
hook:
@poetry run pre-commit install
migrate:
@poetry run python manage.py migrate
migrations:
@poetry run python manage.py makemigrations
lint:
@poetry run pre-commit run --all-files