forked from open-craft/xblock-html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (44 loc) · 1.89 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
.PHONY: clean requirements
.DEFAULT_GOAL := help
help: ### Display this help message
@echo "Please use \`make <target>' where <target> is one of"
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
clean: ## Remove generated byte code, coverage reports, and build artifacts
@echo "--> Clean Python files ..."
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
@echo "--> Clean other files ..."
rm -fr var/
coverage erase
@echo "The project has been cleaned successfully."
selfcheck: ## Check that the Makefile is well-formed
@echo "The Makefile is well-formed."
base_requirements: ## Install requirements needed at all times
pip install -q -r requirements/base.txt --exists-action w
test_requirements: base_requirements ## Install requirements needed by test environment
pip install -q -r requirements/quality.txt --exists-action w
pip install -q -r requirements/test.txt --exists-action w
requirements: base_requirements test_requirements ## Installs all requirements needed by developmenent and test environments
pip install -e .
@echo "Finished installing requirements."
quality: ## Run quality tests and checks
make selfcheck
pylint html_xblock tests
pycodestyle html_xblock tests --config=pylintrc
pydocstyle html_xblock tests --config=pylintrc
isort --check-only --diff --recursive tests html_xblock
unit-coverage: clean ## Run coverage and unit tests
mkdir var/
coverage run ./manage.py test
coverage html
coverage xml
diff-cover coverage.xml --html-report diff-cover.html
unit: clean ## Run unit tests
mkdir var/
python manage.py test
test: clean quality unit-coverage ## Run tests and coverage report in the current virtualenv