-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.06 KB
/
Makefile
File metadata and controls
62 lines (49 loc) · 1.06 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
NUM_TEST_RETRY=4
#
# Installation
#
.PHONY: setup
setup:
pip install -U uv
.PHONY: install
install:
uv sync --all-extras
#
# linter/formatter/typecheck
#
.PHONY: lint
lint: install
uv run ruff check --output-format=github scripts
uv run nbqa ruff notebooks
.PHONY: format
format: install
uv run ruff format --check --diff .
.PHONY: typecheck
typecheck: install
uv run mypy scripts
uv run nbqa mypy notebooks
.PHONY: apply-formatter
apply-formatter: install
uv run ruff check --select I --fix notebooks
uv run ruff format
#
# jupytext
#
.PHONY: sync-script-to-notebook
sync-script-to-notebook: install
uv run jupytext --sync scripts/*.py
.PHONY: sync-notebook-to-script
sync-notebook-to-script: install
uv run jupytext --sync notebooks/*.ipynb
#
# LaTeX code generation
#
.PHONY: generate-latex-code
generate-latex-code: install
uv run scripts/convert_cell_to_latex.py --notebooks-dir notebooks --output-dir latex/code
#
# Testing
#
.PHONY: test-notebooks
test-notebooks: install
uv run pytest --force-flaky --max-runs=$(NUM_TEST_RETRY) --nbmake notebooks/*.ipynb