-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (40 loc) · 1.04 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
.PHONY: all env install nopyc clean build build-migrations migrate test
SHELL := /usr/bin/env bash
PYTHON_BIN ?= python
TWILTWIL_VENV ?= venv
all: build migrate test
env:
cp -n .env.example .env | true
venv:
$(PYTHON_BIN) -m pip install virtualenv --user
$(PYTHON_BIN) -m virtualenv $(TWILTWIL_VENV)
install: env venv
( \
source $(TWILTWIL_VENV)/bin/activate; \
python -m pip install -r requirements.txt -r requirements-dev.txt; \
)
nopyc:
find . -name '*.pyc' | xargs rm -f || true
find . -name __pycache__ | xargs rm -rf || true
clean: nopyc
rm -rf build $(TWILTWIL_VENV)
build: install
( \
source $(TWILTWIL_VENV)/bin/activate; \
python manage.py collectstatic --noinput; \
)
build-migrations: install
( \
source $(TWILTWIL_VENV)/bin/activate; \
python manage.py makemigrations; \
)
migrate: install
( \
source $(TWILTWIL_VENV)/bin/activate; \
python manage.py migrate; \
)
test: install
( \
source $(TWILTWIL_VENV)/bin/activate; \
coverage run manage.py test && coverage report && coverage html && coverage xml; \
)