forked from ran-isenberg/aws-lambda-handler-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile_windows
67 lines (50 loc) · 2.02 KB
/
Makefile_windows
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
.PHONY: dev lint complex coverage pre-commit yapf sort deploy destroy deps unit integration e2e pipeline-tests docs lint-docs
dev:
pip install --upgrade pip pre-commit poetry
pre-commit install
poetry config --local virtualenvs.in-project true
poetry install
lint:
@echo "Running flake8"
flake8 service\* cdk\* tests\* docs\examples\* --exclude patterns='build,cdk.json,cdk.context.json,.yaml'
@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\*' .
sort:
isort
pre-commit:
pre-commit run -a --show-diff-on-failure
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
mypy-lint:
mypy --pretty service docs\examples cdk tests
unit:
pytest tests\unit --cov-config=.coveragerc --cov=service --cov-report xml
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 yapf sort pre-commit complex lint lint-docs unit integration e2e
yapf:
yapf -i -vv --style=.\.style --exclude=.venv --exclude=.build --exclude=cdk.out --exclude=.git -r .
pipeline-tests:
pytest tests\unit tests\integration --cov-config=.coveragerc --cov=service --cov-report xml
deploy:
make deps
if not exist ".build\lambdas\service" mkdir ".build\lambdas\service"
rmdir /S /Q .build\lambdas\service
echo D | xcopy /f /y service .build\lambdas\service /s
if not exist ".build\common_layer" mkdir ".build\common_layer"
poetry export --without=dev --without-hashes --format=requirements.txt > .build\common_layer\requirements.txt
cdk deploy --app="python app.py" --require-approval=never
destroy:
cdk destroy --app="python app.py" --force
docs:
mkdocs serve
lint-docs:
docker run -v \markdown 06kellyjac\markdownlint-cli --fix "docs"