-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
44 lines (31 loc) · 1.07 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
PIP_COMPILE_FLAGS = -U --generate-hashes --build-isolation --allow-unsafe --resolver=backtracking
PYTHON_SOURCES = 030-decorators/*.py 050-exceptions/*.py 060-logging/*.py 060-logging/submodule/*.py
default: check
check: black-check flake8 mypy pytest isort-check
fmt: black isort
black:
black $(PYTHON_SOURCES)
black-check:
black --check --diff $(PYTHON_SOURCES)
flake8:
flake8 $(PYTHON_SOURCES)
isort:
isort $(PYTHON_SOURCES)
isort-check:
isort --check --diff $(PYTHON_SOURCES)
mypy:
mypy $(PYTHON_SOURCES)
pytest:
pytest -v --color=yes --durations=20 --doctest-modules $(PYTHON_SOURCES)
clean:
rm -rf .pytest_cache
rm -rf .mypy_cache
find -type d -name '__pycache__' | xargs --no-run-if-empty rm -rf
cleanall: clean
rm -rf venv
requirements:
pip install -U pip-tools
@echo "# Please seat back and relax, this may take some time. :)"
pip-compile $(PIP_COMPILE_FLAGS) -o requirements.txt requirements.in
pip-compile $(PIP_COMPILE_FLAGS) -o requirements-dev.txt requirements-dev.in
.PHONY: default fmt check black black-check flake8 mypy pytest docs rtfm requirements