-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (40 loc) · 1.88 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
.PHONY: help clean upgrade requirements dev-requirements quality test validate
.DEFAULT_GOAL := help
PIP_COMPILE = pip-compile --upgrade
ifdef TOXENV
TOX := tox -- ## isolate each tox environment if TOXENV is defined
endif
APP_MODULE = openedx_lti_tool_plugin
help: ## display this help message
@echo "Please use \`make <target>' where <target> is one of"
@awk -F ':.*?## ' '/^[a-zA-Z]/ && NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
clean: ## remove generated byte code, coverage reports, and build artifacts
find . -name '__pycache__' -exec rm -rf {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
# Make sure to compile files after any other files they include!
$(PIP_COMPILE) --allow-unsafe -o requirements/pip-tools.txt requirements/pip-tools.in
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
$(PIP_COMPILE) -o requirements/test.txt requirements/test.in
# Let tox control the Django version for tests
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
requirements: ## install core requirements
pip install -r requirements/base.txt
dev-requirements: requirements ## install development requirements and Django
pip install -r requirements/test.txt
quality: ## check coding style
$(TOX) pylint ${APP_MODULE} manage.py setup.py
$(TOX) pycodestyle ${APP_MODULE} manage.py setup.py
$(TOX) pydocstyle ${APP_MODULE} manage.py setup.py
$(TOX) isort --check-only --diff ${APP_MODULE} manage.py setup.py
test: ## run tests
$(TOX) python manage.py check
$(TOX) pytest
validate: quality test ## run tests and quality checks