-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
50 lines (39 loc) · 1.54 KB
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
# Common development targets for o3de_release_notes_generator.
# All targets are no-install: they invoke `python -m <tool>` directly so they
# work on a fresh clone without `pip install`. Optional tools (ruff, mypy)
# print a hint and exit cleanly if not installed, rather than failing.
.PHONY: help test sbom sbom-check lint typecheck dry-run-help all check clean
PYTHON ?= python
help:
@echo "Targets:"
@echo " test Run pytest"
@echo " sbom Regenerate sbom.cdx.json"
@echo " sbom-check Verify sbom.cdx.json is current (CI gate)"
@echo " lint Run ruff (skipped if not installed)"
@echo " typecheck Run mypy (skipped if not installed)"
@echo " check test + lint + typecheck + sbom-check"
@echo " clean Remove __pycache__, .pytest_cache, *.pyc"
test:
$(PYTHON) -m pytest tests/ -v
sbom:
$(PYTHON) generate_sbom.py
sbom-check:
$(PYTHON) generate_sbom.py --check
lint:
@if $(PYTHON) -m ruff --version >/dev/null 2>&1; then \
$(PYTHON) -m ruff check release_notes.py generate_sbom.py tests/; \
else \
echo "ruff not installed — skipping (install with: pip install ruff)"; \
fi
typecheck:
@if $(PYTHON) -m mypy --version >/dev/null 2>&1; then \
$(PYTHON) -m mypy release_notes.py generate_sbom.py; \
else \
echo "mypy not installed — skipping (install with: pip install mypy)"; \
fi
check: test lint typecheck sbom-check
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
rm -rf .pytest_cache .mypy_cache .ruff_cache
find . -name '*.pyc' -delete
all: check sbom