This repository was archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (66 loc) · 1.73 KB
/
Makefile
File metadata and controls
95 lines (66 loc) · 1.73 KB
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
.PHONY: virtualenv requirements requirements_dev test coverage coverage_html format lint activate clean_cache
PYTHON ?= python3.8
VENV ?= ./venv
ENV_PYTHON ?= $(VENV)/bin/python
MANAGE ?= $(ENV_PYTHON) manage.py
virtualenv:
@if [ ! -d "$(VENV)" ]; then \
$(PYTHON) -m venv $(VENV); \
$(VENV)/bin/pip install pip; \
fi
requirements: virtualenv
$(VENV)/bin/pip install -r requirements.txt
$(VENV)/bin/pip install -r requirements/development.txt
migrate:
$(MANAGE) migrate
collectstatic:
$(MANAGE) collectstatic --noinput
loaddata:
$(MANAGE) loaddata dhost/demo/fixture.json
api-develop: requirements_dev collectstatic migrate
demo: develop loaddata
clean_db:
if [ -f "db.sqlite3" ]; then \
rm db.sqlite3; \
fi
clean: clean_db
test:
$(MANAGE) makemigrations --dry-run
$(MANAGE) test --settings dhost.settings.tests
coverage:
$(ENV_PYTHON) -m coverage run manage.py test --settings dhost.settings.tests
$(ENV_PYTHON) -m coverage report -m
coverage_html:
$(ENV_PYTHON) -m coverage html
runserver:
$(MANAGE) runserver
black:
$(ENV_PYTHON) -m black .
black-check:
$(ENV_PYTHON) -m black --check .
isort:
$(ENV_PYTHON) -m isort .
isort-check:
$(ENV_PYTHON) -m isort --check .
format: black isort
flake8:
$(ENV_PYTHON) -m flake8 .
lint: flake8 black-check isort-check
prepare-dashboard:
@if [ ! -d "dhost/frontend/node_modules" ]; then \
cd dhost/frontend; \
yarn install; \
fi
build-dashboard: prepare-dashboard
cd dhost/frontend
yarn build
start-dashboard: prepare-dashboard
cd dhost/frontend
yarn start
test-dashboard: prepare-dashboard
cd dhost/frontend
yarn test
dashboard-develop: build-dashboard start-dashboard
develop: api-develop build-dashboard
# after pulling a new version
refresh: clean develop