generated from ran-isenberg/aws-serverless-cron-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (50 loc) · 1.75 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
.PHONY: dev lint complex coverage pre-commit yapf sort deploy destroy deps unit integration e2e pipeline-tests docs lint-docs build
dev:
pip install --upgrade pip pre-commit poetry
make deps
pre-commit install
poetry shell
format:
poetry run ruff check . --fix
format-fix:
poetry run ruff format .
lint:
@echo "Running mypy"
make mypy-lint
complex:
@echo "Running Radon"
radon cc -e 'tests/*,cdk.out/*' .
@echo "Running xenon"
xenon --max-absolute B --max-modules A --max-average A -e 'tests/*,.venv/*,cdk.out/*' .
pre-commit:
pre-commit run -a --show-diff-on-failure
mypy-lint:
mypy --pretty service cdk tests
deps:
poetry export --only=dev --without-hashes --format=requirements.txt > dev_requirements.txt
poetry export --without=dev --without-hashes --format=requirements.txt > lambda_requirements.txt
unit:
pytest tests/unit --cov-config=.coveragerc --cov=service --cov-report xml
build:
make deps
mkdir -p .build/lambdas ; cp -r service .build/lambdas
mkdir -p .build/common_layer ; poetry export --without=dev --without-hashes --format=requirements.txt > .build/common_layer/requirements.txt
integration:
pytest tests/integration --cov-config=.coveragerc --cov=service --cov-report xml
e2e:
pytest tests/e2e --cov-config=.coveragerc --cov=service --cov-report xml
pr: deps pre-commit complex lint unit deploy integration e2e
pipeline-tests:
pytest tests/unit tests/integration --cov-config=.coveragerc --cov=service --cov-report xml
deploy:
make build
cdk deploy --app="python3 ${PWD}/app.py" --require-approval=never
destroy:
cdk destroy --app="python3 ${PWD}/app.py" --force
docs:
mkdocs serve
lint-docs:
docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli --fix "docs"
update-deps:
poetry update
pre-commit autoupdate