Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (63 loc) · 2.81 KB
/
Copy pathMakefile
File metadata and controls
78 lines (63 loc) · 2.81 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
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
77
78
.PHONY: help check export render manifest test verify courses paths lint lock lock-check all
PYTHON ?= python3
UV ?= uv
# Lock files are resolved once for every supported Python and platform
# (--universal from the 3.11 floor). The dev lock is constrained to the
# runtime lock so both always agree on shared packages.
UV_COMPILE = $(UV) pip compile pyproject.toml --universal --python-version 3.11 \
--custom-compile-command "make lock" --quiet
define compile_locks
$(UV_COMPILE) -o requirements.lock.txt
$(UV_COMPILE) --extra dev -c requirements.lock.txt -o requirements-dev.lock.txt
endef
help:
@echo "FlyPython Development Workflow:"
@echo " make check - Run the same checks as CI: lint, tests, catalog, radar, export, readme, manifest, example, course, and path checks"
@echo " make export - Regenerate catalog.json and radar.json"
@echo " make render - Regenerate root and catalog README indexes plus the Radar table"
@echo " make manifest - Regenerate content-manifest.json"
@echo " make lint - Run ruff"
@echo " make test - Run pytest test suite"
@echo " make verify - Verify all runnable examples"
@echo " make courses - Verify all course folders"
@echo " make paths - Verify all learning-path contracts"
@echo " make lock - Re-resolve requirements*.lock.txt from pyproject.toml (keeps existing pins where valid)"
@echo " make lock-check - Fail if the lock files no longer match pyproject.toml"
@echo " make all - Regenerate all exports and run all checks and tests"
check: lint test
$(PYTHON) tools/validate_catalog.py
$(PYTHON) tools/export_catalog.py --check --target both
$(PYTHON) tools/render_readmes.py --check
$(PYTHON) tools/build_content_manifest.py --check
$(PYTHON) tools/verify_examples.py
$(PYTHON) tools/verify_courses.py
$(PYTHON) tools/verify_paths.py
export:
$(PYTHON) tools/export_catalog.py --target both
render:
$(PYTHON) tools/render_readmes.py
manifest:
$(PYTHON) tools/build_content_manifest.py
lint:
$(PYTHON) -m ruff check .
test:
$(PYTHON) -m pytest
verify:
$(PYTHON) tools/verify_examples.py
courses:
$(PYTHON) tools/verify_courses.py
paths:
$(PYTHON) tools/verify_paths.py
lock:
$(compile_locks)
# Re-resolve copies of the committed locks in a scratch directory: uv keeps
# every committed pin that still satisfies pyproject.toml, so any diff means
# the locks drifted from the declared dependencies.
lock-check:
@tmp=$$(mktemp -d) && \
cp pyproject.toml requirements.lock.txt requirements-dev.lock.txt "$$tmp/" && \
$(MAKE) --no-print-directory -C "$$tmp" -f "$(CURDIR)/Makefile" lock && \
diff -u requirements.lock.txt "$$tmp/requirements.lock.txt" && \
diff -u requirements-dev.lock.txt "$$tmp/requirements-dev.lock.txt" && \
rm -rf "$$tmp" && echo "lock files match pyproject.toml"
all: export render manifest check