-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
108 lines (99 loc) · 2.08 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
appname = example
package = example
# Default goal
.DEFAULT_GOAL := help
# Help
.PHONY: help
help:
@echo ""
@echo "$(appname_verbose) Makefile"
@echo ""
@echo "Usage:"
@echo " make [command]"
@echo ""
@echo "Commands:"
@echo " build_test Build the package"
@echo " coverage Run tests and create a coverage report"
@echo " graph_models Create a graph of the models"
@echo " pre-commit-checks Run pre-commit checks"
@echo " tox_tests Run tests with tox"
@echo " translations Create or update translation files"
@echo " compile_translations Compile translation files"
@echo ""
# Translation files
.PHONY: translations
translations:
@echo "Creating or updating translation files"
@django-admin makemessages \
-l cs_CZ \
-l de \
-l es \
-l fr_FR \
-l it_IT \
-l ja \
-l ko_KR \
-l nl_NL \
-l pl_PL \
-l ru \
-l sk \
-l uk \
-l zh_Hans \
--keep-pot \
--ignore 'build/*'
# Compile translation files
.PHONY: compile_translations
compile_translations:
@echo "Compiling translation files"
@django-admin compilemessages \
-l cs_CZ \
-l de \
-l es \
-l fr_FR \
-l it_IT \
-l ja \
-l ko_KR \
-l nl_NL \
-l pl_PL \
-l ru \
-l sk \
-l uk \
-l zh_Hans
# Graph models
.PHONY: graph_models
graph_models:
@echo "Creating a graph of the models"
@python ../myauth/manage.py \
graph_models \
$(package) \
--arrow-shape normal \
-o $(appname)-models.png
# Coverage
.PHONY: coverage
coverage:
@echo "Running tests and creating a coverage report"
@rm -rf htmlcov
@coverage run ../myauth/manage.py \
test \
$(package) \
--keepdb \
--failfast; \
coverage html; \
coverage report -m
# Build test
.PHONY: build_test
build_test:
@echo "Building the package"
@rm -rf dist
@python3 -m build
# Tox tests
.PHONY: tox_tests
tox_tests:
@echo "Running tests with tox"
@export USE_MYSQL=False; \
tox -v -e allianceauth-latest; \
rm -rf .tox/
# Pre-commit checks
.PHONY: pre-commit-checks
pre-commit-checks:
@echo "Running pre-commit checks"
@pre-commit run --all-files