forked from marimo-team/marimo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (86 loc) · 2.27 KB
/
Makefile
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.PHONY: help
# show this help
help:
@# prints help for rules preceded with comment
@# https://stackoverflow.com/a/35730928
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' Makefile | column -s: -t
# package frontend into marimo/
.PHONY: fe
fe: marimo/_static marimo/_lsp
# install/build frontend if anything under frontend/src or (top-level)
# frontend/ has changed
marimo/_static: $(shell find frontend/src) $(wildcard frontend/*)
cd frontend; pnpm install; cd ..; ./scripts/buildfrontend.sh
# install/build lsp if anything in lsp/ has changed
marimo/_lsp: $(shell find lsp)
cd lsp; pnpm install; cd ..; ./scripts/buildlsp.sh
.PHONY: py
# editable python install; only need to run once
py:
pip install -e .[dev]
.PHONY: check
# run all checks
check: fe-check py-check
.PHONY: check-test
# run all checks and tests
check-test: check fe-test py-test e2e
.PHONY: test
# run all checks and tests
test: fe-test py-test e2e
.PHONY: fe-check
# check frontend
fe-check: fe-lint fe-typecheck
.PHONY: fe-test
# test frontend
fe-test:
cd frontend; CI=true pnpm turbo test
.PHONY: e2e
# test end-to-end
e2e:
cd frontend; npx playwright install; npx playwright test
.PHONY: fe-lint
fe-lint:
cd frontend/src && typos && cd - && cd frontend && pnpm lint
.PHONY: fe-typecheck
fe-typecheck:
cd frontend; pnpm turbo typecheck
.PHONY: fe-codegen
fe-codegen:
cd openapi; pnpm install; pnpm codegen
.PHONY: py-check
# check python
py-check:
./scripts/pyfix.sh
.PHONY: py-test
# test python
py-test:
cd marimo && typos && cd - && pytest;
.PHONY: py-snapshots
# update html snapshots
py-snapshots:
pytest tests/_server/templates/test_templates.py
pytest tests/_server/api/endpoints/test_export.py
.PHONY: install-all
# install everything; takes a long time due to editable install
install-all: fe py
.PHONY: wheel
# build wheel
wheel:
python -m build
.PHONY: storybook
storybook:
cd frontend; pnpm storybook
.PHONY: docs
# build docs
# use make ARGS="-a" docs to force docs to rebuild, useful when
# modifying static files / assets
docs:
sphinx-build $(ARGS) docs/ docs/_build
.PHONY: docs-auto
# autobuild docs
docs-auto:
sphinx-autobuild $(ARGS) docs/ docs/_build
.PHONY: docs-clean
# remove built docs
docs-clean:
cd docs && make clean