Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (77 loc) · 2.9 KB
/
Copy pathMakefile
File metadata and controls
93 lines (77 loc) · 2.9 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SHELL := /bin/bash
.PHONY: env check format test test-licensed test-long test-all render render-licensed render-long render-all review restore upgrade
# Examples:
# make render # Render default notebooks
# make render TARGET="02-technical-guides/auto-cube/main.ipynb" # Render specific notebook
# make render TARGET="auto-cube/main.ipynb conditional-functions/main.ipynb" # Multiple notebooks
# make render TARGET="licensed" # Render licensed notebooks
# make render TARGET="default licensed" # Render default + licensed
# make render TARGET="auto-cube/main.ipynb default" # Mix individual + groups
# Set up the Python environment and install pre-commit hooks
env:
pip install --quiet --disable-pip-version-check uv
uv sync
uv run pre-commit install
# Check code formatting using ruff
check: env
uv run ruff format --check .
# Format code using ruff
format: env
uv run ruff format .
# Run default notebook tests
test: check format
uv run python tests/test_notebooks.py --target=default
# Run tests for licensed notebooks
test-licensed: check format
./tests/scripts/install_dq.sh
uv run python tests/test_notebooks.py --target=licensed
# Run tests for long-running notebooks
test-long: check format
uv run python tests/test_notebooks.py --target=long-running
# Run all notebook tests
test-all: check format
./tests/scripts/install_dq.sh
uv run python tests/test_notebooks.py --target=default,licensed,long-running
# Render specific notebooks or groups in JupyterLab using Playwright
# Usage: make render TARGET="notebook1.ipynb notebook2.ipynb"
# Or: make render TARGET="default licensed"
# Or: make render TARGET="02-technical-guides/auto-cube/main.ipynb"
ifdef TARGET
render: check format
uv run playwright install
uv run playwright install-deps
./tests/scripts/render.sh $(TARGET)
else
# Default render target (backward compatibility)
render: check format
uv run playwright install
uv run playwright install-deps
./tests/scripts/render.sh default
endif
# Render licensed notebooks in JupyterLab using Playwright
render-licensed: check format
./tests/scripts/install_dq.sh
uv run playwright install
uv run playwright install-deps
./tests/scripts/render.sh licensed
# Render long-running notebooks in JupyterLab using Playwright
render-long: check format
uv run playwright install
uv run playwright install-deps
./tests/scripts/render.sh long-running
# Render all notebooks in JupyterLab using Playwright
render-all: check format
./tests/scripts/install_dq.sh
uv run playwright install
uv run playwright install-deps
./tests/scripts/render.sh default licensed long-running
# Launch JupyterLab for review
review:
uv run jupyter-lab --port=8888
# Restore Atoti database files to their original state
restore:
git restore --staged '**/content.mv.db'
git restore '**/content.mv.db'
# Run all tests and render notebooks
upgrade:
make test-all && make render-all