-
Notifications
You must be signed in to change notification settings - Fork 77
/
Makefile
66 lines (52 loc) · 1.99 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
63
64
65
66
.PHONY: clean-pyc clean-build docs clean
ADDITIONAL_COVERAGE_FLAGS ?=
INSTALL_FILE ?= requirements-dev.txt
INSTALL_LOG ?= /dev/stdout
help: ## show help
@grep -E '^[a-zA-Z_\-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
cut -d':' -f1- | \
sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## install all requirements including for testing
pip install -r $(INSTALL_FILE) 2>&1 > $(INSTALL_LOG)
pip freeze
clean: clean-build clean-pyc ## remove all artifacts
clean-build: ## remove build artifacts
@rm -rf build/
@rm -rf dist/
@rm -rf *.egg-info
clean-pyc: ## remove Python file artifacts
-@find . -name '*.pyc' -not -path "./.tox/*" -follow -print0 | xargs -0 rm -f
-@find . -name '*.pyo' -not -path "./.tox/*" -follow -print0 | xargs -0 rm -f
-@find . -name '__pycache__' -type d -not -path "./.tox/*" -follow -print0 | xargs -0 rm -rf
clean-test: ## remove test and coverage artifacts
rm -rf .coverage coverage*
rm -rf htmlcov/
clean-test-all: clean-test ## remove all test-related artifacts including tox
rm -rf .tox/
lint: ## lint whole library
if python -c "import sys; exit(1) if sys.version[:3] < '3.6' or getattr(sys, 'pypy_version_info', None) else exit(0)"; \
then \
pre-commit run --all-files ; \
fi
test: ## run tests quickly with the default Python
py.test -sv \
--cov=url_filter \
--cov-report=term-missing \
$(ADDITIONAL_COVERAGE_FLAGS) \
--doctest-modules \
tests/ url_filter/
test-all: ## run tests on every Python version with tox
tox
check: lint clean-build clean-pyc clean-test test ## run all necessary steps to check validity of project
dist: clean ## build python package ditribution
check-manifest
python setup.py sdist bdist_wheel
ls -l dist
twine check dist/*
release: clean dist ## package and upload a release
twine upload dist/*
syncdb: ## apply all migrations and load fixtures
python manage.py migrate
python manage.py migrate --run-syncdb
python manage.py loaddata one_to_one many_to_one many_to_many