This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
61 lines (45 loc) · 2.41 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
.PHONY: clean test upgrade requirements quality quality-python test-python
# Generates a help message. Borrowed from https://github.com/pydanny/cookiecutter-djangopackage.
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: ## delete generated byte code and coverage reports
find . -name '*.pyc' -delete
find . -name '__pycache__' -type d -exec rm -rf {} ';' || true
coverage erase
rm -rf assets
rm -rf pii_report
PACKAGES = video_worker
validate: test ## Run tests and quality checks
test-python: clean ## Run tests using pytest & generate report
pytest --cov-report=term-missing --cov-branch \
--junit-xml=build/coverage/coverage.xml --verbosity=2 \
--html=build/coverage/report.html --self-contained-html \
$(foreach package,$(PACKAGES),--cov=$(package)) \
$(PACKAGES)
test: test-python
quality-python:
pep8 --config=.pep8 $(PACKAGES) *.py
pylint --rcfile=pylintrc $(PACKAGES) *.py
quality: quality-python
piptools: ## install pinned version of pip-compile and pip-sync
pip install -r requirements/pip-tools.txt
requirements: piptools ci_requirements ## sync to default requirements
ci_requirements: validation_requirements ## sync to requirements needed for CI checks
dev_requirements: ## sync to requirements for local development
pip-sync -q requirements/dev.txt
validation_requirements: piptools ## sync to requirements for testing & code quality checking
pip-sync -q requirements/travis.txt
doc_requirements:
pip-sync -q requirements/doc.txt
prod_requirements: ## install requirements for production
pip-sync -q requirements/production.txt
upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: piptools ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
# Make sure to compile files after any other files they include!
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/travis.txt requirements/travis.in
pip-compile --upgrade -o requirements/production.txt requirements/production.in