-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
62 lines (48 loc) · 1.65 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
PYTHON ?= python3
export VIRTUAL_ENV := $(realpath .)/venv
export TOX_DIR := $(realpath .)/.tox
export PATH := $(VIRTUAL_ENV)/bin:$(PATH)
export DJANGO_MANAGE := $(TOX_DIR)/py36-d111/bin/python examples/djangoapp/manage.py
unexport WORKON_HOME PIP_RESPECT_VIRTUALENV PIP_VIRTUALENV_BASE
help:
@echo
@echo 'Make targets:'
@echo ' make install'
@echo ' -> make install.virtualenv'
@echo ' -> make install.runtime'
@echo ' make clean'
@echo ' make test'
@echo ' make tdd'
@echo ' make django_makemigrations'
# Top-level phony targets
_install__runtime = $(VIRTUAL_ENV)/bin/django-admin.py
_install__virtualenv = $(VIRTUAL_ENV)/bin/pip
# make should not confuse these commands with files
.PHONY: install install.virtualenv install.runtime
.PHONY: clean
clean:
rm -rf $(VIRTUAL_ENV)
find . -type f -name '*.pyc' -print0 | xargs -0 rm -f
find . -type d -name '__pycache__' -print0 | xargs -0 rm -rf
# Installation
install: install.virtualenv install.runtime
install.runtime: $(_install__runtime)
install.virtualenv: $(_install__virtualenv)
$(_install__runtime):
$(_install__virtualenv) install -r requirements/devel.txt
$(VIRTUAL_ENV)/bin/python setup.py develop
touch $@
$(_install__virtualenv):
$(PYTHON) -mvenv $(VIRTUAL_ENV)
@echo '================================================================'
@echo 'You can now enable virtualenv with:'
@echo ' source $(VIRTUAL_ENV)/bin/activate'
@echo '================================================================'
touch $@
$(VIRTUAL_ENV)/bin/pip install -U pip
test:
$(VIRTUAL_ENV)/bin/py.test ./cq
tdd:
$(VIRTUAL_ENV)/bin/ptw -c -- ./cq
django_makemigrations:
$(DJANGO_MANAGE) makemigrations cq