forked from aws-powertools/powertools-lambda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (57 loc) · 1.67 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
target:
@$(MAKE) pr
dev:
pip install --upgrade pip poetry pre-commit
poetry install --extras "pydantic"
pre-commit install
dev-docs:
cd docs && yarn install
format:
poetry run isort -rc aws_lambda_powertools tests
poetry run black aws_lambda_powertools tests
lint: format
poetry run flake8 aws_lambda_powertools/* tests/*
test:
poetry run pytest -vvv --cov=./ --cov-report=xml
coverage-html:
poetry run pytest --cov-report html
pr: lint test security-baseline complexity-baseline
build: pr
poetry build
build-docs:
@$(MAKE) build-docs-website
@$(MAKE) build-docs-api
build-docs-api: dev
mkdir -p dist/api
poetry run pdoc --html --output-dir dist/api/ ./aws_lambda_powertools --force
mv -f dist/api/aws_lambda_powertools/* dist/api/
rm -rf dist/api/aws_lambda_powertools
build-docs-website: dev-docs
mkdir -p dist
cd docs && yarn build
cp -R docs/public/* dist/
docs-local: dev-docs
cd docs && yarn start
docs-api-local:
poetry run pdoc --http : aws_lambda_powertools
security-baseline:
poetry run bandit --baseline bandit.baseline -r aws_lambda_powertools
complexity-baseline:
$(info Maintenability index)
poetry run radon mi aws_lambda_powertools
$(info Cyclomatic complexity index)
poetry run xenon --max-absolute C --max-modules A --max-average A aws_lambda_powertools
#
# Use `poetry version <major>/<minor></patch>` for version bump
#
release-prod:
poetry config pypi-token.pypi ${PYPI_TOKEN}
poetry publish -n
release-test:
poetry config repositories.testpypi https://test.pypi.org/legacy
poetry config pypi-token.pypi ${PYPI_TEST_TOKEN}
poetry publish --repository testpypi -n
release: pr
poetry build
$(MAKE) release-test
$(MAKE) release-prod