-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
82 lines (58 loc) · 1.56 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
py_sources = txstratum/ $(wildcard *.py)
py_tests = tests/ $(wildcard *.py)
.PHONY: all
all: check tests
# testing:
tests_lib = ./tests/
pytest_flags = -p no:warnings --cov-report=term --cov-report=html --cov=txstratum
mypy_tests_flags = --show-error-code --warn-unused-configs --disallow-incomplete-defs --no-implicit-optional --warn-redundant-casts --strict-equality --disallow-subclassing-any --warn-return-any --disallow-untyped-decorators
mypy_sources_flags = --strict --show-error-code
#--disallow-any-generics
#--disallow-untyped-calls
#--warn-unused-ignores
#--disallow-untyped-defs
#--check-untyped-defs
#--implicit-reexport
#--no-implicit-reexport
.PHONY: tests-lib
tests-lib:
pytest --durations=10 $(pytest_flags) --doctest-modules txstratum --cov-fail-under=70 $(tests_lib)
.PHONY: tests
tests: tests-lib
# checking:
#
.PHONY: mypy
mypy: mypy-sources mypy-tests
.PHONY: mypy-sources
mypy-sources: $(py_sources)
mypy $(mypy_sources_flags) $^
.PHONY: mypy-tests
mypy-tests: $(py_tests)
mypy $(mypy_tests_flags) $^
.PHONY: flake8
flake8: $(py_sources) $(py_tests)
flake8 $^
.PHONY: isort-check
isort-check: $(py_sources) $(py_tests)
isort --check-only $^
.PHONY: black-check
black-check:
black --check .
.PHONY: check
check: flake8 black-check isort-check mypy
# formatting:
.PHONY: fmt
fmt: black isort
.PHONY: black
black:
black .
.PHONY: isort
isort: $(py_sources) $(py_tests)
isort --ac $^
# cleaning:
.PHONY: clean-pyc
clean-pyc:
find txstratum tests -name \*.pyc -delete
find txstratum tests -name __pycache__ -delete
.PHONY: clean
clean: clean-protos