forked from ccnmtl/django-lti-provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (38 loc) · 987 Bytes
/
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
PY_DIRS=lti_provider
VE ?= ./ve
REQUIREMENTS ?= test_reqs.txt
SYS_PYTHON ?= python3
PY_SENTINAL ?= $(VE)/sentinal
WHEEL_VERSION ?= 0.33.6
PIP_VERSION ?= 20.0.2
MAX_COMPLEXITY ?= 7
INTERFACE ?= localhost
RUNSERVER_PORT ?= 8000
PY_DIRS ?= $(APP)
DJANGO ?= "Django==2.2.13"
# Travis has issues here. See:
# https://github.com/travis-ci/travis-ci/issues/9524
ifeq ($(TRAVIS),true)
FLAKE8 ?= flake8
PIP ?= pip
else
FLAKE8 ?= $(VE)/bin/flake8
PIP ?= $(VE)/bin/pip
endif
all: flake8 test
clean:
rm -rf $(VE)
find . -name '*.pyc' -exec rm {} \;
$(PY_SENTINAL):
rm -rf $(VE)
$(SYS_PYTHON) -m venv $(VE)
$(PIP) install pip==$(PIP_VERSION)
$(PIP) install --upgrade setuptools
$(PIP) install wheel==$(WHEEL_VERSION)
$(PIP) install --no-deps --requirement $(REQUIREMENTS) --no-binary cryptography
$(PIP) install "$(DJANGO)"
touch $@
test: $(REQUIREMENTS) $(PY_SENTINAL)
./ve/bin/python runtests.py
flake8: $(PY_SENTINAL)
$(FLAKE8) $(PY_DIRS) --max-complexity=$(MAX_COMPLEXITY)