-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
111 lines (67 loc) · 2.3 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
109
110
111
.DEFAULT_GOAL=""
VIRTUALENV_PATH=.venv
API_DOCS_PATH=docs/source/api
venv:
test -d $(VIRTUALENV_PATH) || virtualenv $(VIRTUALENV_PATH) -p python3
venv.clean:
rm -rf $(VIRTUALENV_PATH)
deps.install:
pip install -r requirements/requirements-dev.txt
pip install -r requirements/requirements.txt
pip install -r requirements/requirements-docs.txt
pip install -r requirements/requirements-django.txt
pip install -r requirements/requirements-samples.txt
link:
pip install -e .
prepare: deps.install link
django.migrations:
cd dev/django/ && python manage.py makemigrations revy --no-header
django.migrate:
cd dev/django/ && python manage.py migrate
django: django.migrations django.migrate
typecheck:
mypy . --namespace-packages --explicit-package-bases
mypy.clean:
rm -rf .mypy_cache
test.core:
python -m unittest discover -s tests/ -p 'test_*.py' --verbose
test.samples.django.accounting:
cd samples/django/accounting && \
rm -f db.sqlite3 && \
rm -f ledger/migrations/*.py && \
touch ledger/migrations/__init__.py && \
python manage.py makemigrations ledger --no-header && \
python manage.py migrate && \
python manage.py test ledger
test.samples.django.recovery:
cd samples/django/recovery && \
rm -f db.sqlite3 && \
rm -f users/migrations/*.py && \
touch users/migrations/__init__.py && \
python manage.py makemigrations users --no-header && \
python manage.py migrate && \
python manage.py test users
test.samples.django.swappable:
cd samples/django/swappable && \
rm -f db.sqlite3 && \
rm -f revisions/migrations/*.py && \
touch revisions/migrations/__init__.py && \
yes "1" | yes "1" | python manage.py makemigrations revisions --no-header && \
python ../../../dev/django/misc/prepare_swappable_migration.py && \
python manage.py migrate && \
python manage.py test revisions
test.samples.django: django test.samples.django.accounting test.samples.django.recovery test.samples.django.swappable
test.samples: test.samples.django
.PHONY: test
test: typecheck test.core test.samples
.PHONY: docs
docs:
mkdir -p $(API_DOCS_PATH)
sphinx-apidoc src/revy -f -M -o $(API_DOCS_PATH)
python docs/source/_postprocessors/_run.py
cd docs && make html
.PHONY: docs.clean
docs.clean:
cd docs && make clean
rm -rf $(API_DOCS_PATH)
clean: venv.clean mypy.clean docs.clean