forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (57 loc) · 2.59 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
# Default value for environment variable. Can be overridden by setting the
# environment variable.
SAM_CLI_TELEMETRY ?= 0
init:
SAM_CLI_DEV=1 pip install -e '.[dev]'
test:
# Run unit tests
# Fail if coverage falls below 95%
pytest --cov samcli --cov-report term-missing --cov-fail-under 94 tests/unit
test-cov-report:
# Run unit tests with html coverage report
pytest --cov samcli --cov-report html --cov-fail-under 94 tests/unit
integ-test:
# Integration tests don't need code coverage
@echo Telemetry Status: $(SAM_CLI_TELEMETRY)
SAM_CLI_DEV=1 pytest tests/integration
func-test:
# Verify function test coverage only for `samcli.local` package
@echo Telemetry Status: $(SAM_CLI_TELEMETRY)
pytest --cov samcli.local --cov samcli.commands.local --cov-report term-missing tests/functional
regres-test:
@echo Telemetry Status: $(SAM_CLI_TELEMETRY)
SAM_CLI_DEV=1 pytest tests/regression
smoke-test:
# Smoke tests run in parallel
SAM_CLI_DEV=1 pytest -n 4 tests/smoke
lint:
# Linter performs static analysis to catch latent bugs
ruff samcli
# mypy performs type check
mypy --exclude /testdata/ --exclude /init/templates/ --no-incremental setup.py samcli tests
# Command to run everytime you make changes to verify everything works
dev: lint test
black:
black setup.py samcli tests
black-check:
black --check setup.py samcli tests
format: black
ruff samcli --fix
# Verifications to run before sending a pull request
pr: init dev black-check
# (jfuss) We updated to have two requirement files, one for mac and one for linux. This
# is meant to be a short term fix when upgrading the Linux installer to be python3.11 from
# python3.7. Having different requirements is not ideal but this allows us to isolate changes
# giving us the ability to roll out upgrade to Linux first. When we update the MacOS installer
# we can move to a single file again.
update-reproducible-linux-reqs:
python3.11 -m venv venv-update-reproducible-linux
venv-update-reproducible-linux/bin/pip install --upgrade pip-tools pip
venv-update-reproducible-linux/bin/pip install -r requirements/base.txt
venv-update-reproducible-linux/bin/pip-compile --generate-hashes --allow-unsafe -o requirements/reproducible-linux.txt
update-reproducible-mac-reqs:
python3.7 -m venv venv-update-reproducible-mac
venv-update-reproducible-mac/bin/pip install --upgrade pip-tools pip
venv-update-reproducible-mac/bin/pip install -r requirements/base.txt
venv-update-reproducible-mac/bin/pip-compile --generate-hashes --allow-unsafe -o requirements/reproducible-mac.txt
update-reproducible-reqs: update-reproducible-linux-reqs update-reproducible-mac-reqs