-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (46 loc) · 2.85 KB
/
Copy pathMakefile
File metadata and controls
68 lines (46 loc) · 2.85 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
# --- Deploying Python Package ---
VERSION_BUMP ?= patch
build:
uv version --bump $(VERSION_BUMP) # or minor/major
uv build
publish:
uv publish --token $(PYPI_TOKEN)
clean:
rm -rf ./dist
# --- Tests & QA ---
# Tooling comes from the project's dev dependency group (pinned via uv.lock),
# matching the CI workflows (.github/workflows/*.yml).
RUFF := uv run ruff
# QA groups mirror the CI jobs in .github/workflows/ci.yml.
QA_WRITING := lessons/writing_workflow/src lessons/writing_workflow/scripts lessons/writing_workflow/tests
QA_RESEARCH := lessons/research_agent_part_2/mcp_client lessons/research_agent_part_2/mcp_server lessons/research_agent_part_3/src
QA_CORE := lessons/agents_integration/mcp_client lessons/agents_integration/mcp_server lessons/utils
QA_FOLDERS := $(QA_WRITING) $(QA_RESEARCH) $(QA_CORE)
NOTEBOOKS := $(shell git ls-files '*.ipynb' | grep -v '/inputs/')
format-fix: # Auto-format code and notebooks using ruff formatter.
$(RUFF) format $(QA_FOLDERS) $(NOTEBOOKS)
lint-fix: # Auto-fix linting issues in code and notebooks using ruff linter.
$(RUFF) check --fix $(QA_FOLDERS) $(NOTEBOOKS)
format-check: # Check formatting of code and notebooks without making changes.
$(RUFF) format --check $(QA_FOLDERS) $(NOTEBOOKS)
lint-check: # Check code and notebooks for linting issues without fixing them.
$(RUFF) check $(QA_FOLDERS) $(NOTEBOOKS)
notebooks-validate: # Verify every plain (tracked) lesson notebook conforms to the nbformat schema.
uv run python -c "import sys, nbformat; [nbformat.validate(nbformat.read(f, as_version=4)) for f in sys.argv[1:]]" $(NOTEBOOKS)
test: # Run the writing_workflow unit tests (offline, mocked config).
cd lessons/writing_workflow && CONFIG_FILE=configs/debug.yaml uv run pytest
ci-local: format-check lint-check notebooks-validate test # Run the full CI suite locally.
# --- Course data archives (served raw from GitHub) ---
DATA_SRC := lessons/writing_workflow
DATA_OUT := data
compress-configs: # Zip writing_workflow/configs into data/configs.zip (archive root: configs/).
cd $(DATA_SRC) && rm -f configs.zip && zip -r configs.zip configs -x "*.DS_Store"
mkdir -p $(DATA_OUT) && mv -f $(DATA_SRC)/configs.zip $(DATA_OUT)/configs.zip
compress-inputs: # Zip writing_workflow/inputs into data/inputs.zip (archive root: inputs/).
cd $(DATA_SRC) && rm -f inputs.zip && zip -r inputs.zip inputs -x "*.DS_Store"
mkdir -p $(DATA_OUT) && mv -f $(DATA_SRC)/inputs.zip $(DATA_OUT)/inputs.zip
compress-outputs: # Zip writing_workflow/outputs-cached into data/outputs.zip (archive root: outputs/).
cd $(DATA_SRC) && rm -rf outputs && cp -R outputs-cached outputs && \
rm -f outputs.zip && zip -r outputs.zip outputs -x "*.DS_Store" && rm -rf outputs
mkdir -p $(DATA_OUT) && mv -f $(DATA_SRC)/outputs.zip $(DATA_OUT)/outputs.zip
compress-all: compress-configs compress-inputs compress-outputs # Rebuild all three data archives.