generated from app-sre/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
43 lines (35 loc) · 1.13 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
SITE_PACKAGES_DIR ?= $(shell .venv/bin/python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')
CONTAINER_ENGINE ?= $(shell which podman >/dev/null 2>&1 && echo podman || echo docker)
.PHONY: format
format:
uv run ruff check
uv run ruff format
.PHONY: image_tests
image_tests:
# test /tmp must be empty
[ -z "$(shell ls -A /tmp)" ]
# hooks must be copied
[ -d "hooks" ]
[ -d "hooks_lib" ]
# test all files in ./hooks are executable
[ -z "$(shell find hooks -type f -not -executable ! -name "__init__.py")" ]
.PHONY: code_tests
code_tests:
uv run ruff check --no-fix
uv run ruff format --check
uv run mypy
uv run pytest -vv --cov=er_aws_elasticache --cov-report=term-missing --cov-report xml
.PHONY: dependency_tests
dependency_tests:
python -c "import cdktf_cdktf_provider_random"
python -c "import cdktf_cdktf_provider_aws"
in_container_test: image_tests code_tests dependency_tests
.PHONY: test
test:
$(CONTAINER_ENGINE) build --progress plain --target test -t er-aws-elasticache:test .
.PHONY: build
build:
$(CONTAINER_ENGINE) build --progress plain --target prod -t er-aws-elasticache:prod .
.PHONY: dev
dev:
uv sync