-
Notifications
You must be signed in to change notification settings - Fork 363
/
Makefile
96 lines (74 loc) · 2.47 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
83
84
85
86
87
88
89
90
91
92
93
94
95
help:
@echo 'Zappa Make Targets'
@echo '-----------------------'
@echo 'These targets are aimed at making development, testing, and building easier'
@echo ''
@echo 'Setup'
@echo 'make clean: Remove the built files, local caches, mypy and coverage information'
@echo 'make requirements: Generate requirements from requirements.in and install them to the current environment'
@echo 'make build: Build the source and wheel'
@echo ''
@echo 'Linting'
@echo 'make flake: Flake8 checking'
@echo 'make mypy: Run static type checking for zappa and tests directories'
@echo 'make isort: Sort imports'
@echo 'make black: Format project code according to Black convention'
@echo ''
@echo 'Testing'
@echo 'make tests: Run all project tests. Additional make targets exist for subsets of the tests. Inspect the Makefile for details'
.PHONY: clean requirements build flake mypy isort black tests
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
rm -rf .mypy_cache dist build *.egg-info
coverage erase
requirements:
pip install pip --upgrade
pip install "pipenv>2021.11.15"
pipenv lock
pipenv sync --dev
build: clean requirements
python setup.py sdist
python setup.py bdist_wheel
mypy:
mypy --show-error-codes --pretty --ignore-missing-imports --strict zappa tests
black:
black --line-length 127 .
black-check:
black --line-length 127 . --check
@echo "If this fails, simply run: make black"
isort:
isort . --profile=black
isort-check:
isort --check . --profile=black
flake:
flake8 zappa --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 zappa --count --exit-zero --max-complexity=55 --max-line-length=127 --statistics --ignore F403,F405,E203,E231,E252,W503
test-docs:
pytest tests/tests_docs.py --cov=zappa --durations=0
test-handler:
pytest tests/test_handler.py --cov=zappa --durations=0
test-middleware:
pytest tests/tests_middleware.py --cov=zappa --durations=0
test-placebo:
pytest tests/tests_placebo.py --cov=zappa --durations=0
test-async:
pytest tests/tests_async.py --cov=zappa --durations=0
test-general:
pytest tests/tests.py --cov=zappa --durations=0
test-utilities:
pytest tests/tests_utilities.py --cov=zappa --durations=0
coverage-report:
coverage report --include="*/zappa*"
tests:
make clean
pytest \
tests/tests_docs.py \
tests/test_handler.py \
tests/tests_middleware.py \
tests/tests_placebo.py \
tests/tests_async.py \
tests/tests.py \
tests/tests_utilities.py \
--cov=zappa
--durations=0