-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (60 loc) · 2.06 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
.PHONY: install-dev-deps clean clean-ignored test full-clean all examples schemas stubs install doc-logo cloc deploy-doc
TO_CLEAN := \
-name '__pycache__' -o \
-name '*.pyc' -o \
-name '*.pyo' -o \
-name '*.egg-info' -o \
-name '.pytest_cache' -o \
-name '_build' -o \
-name '.ruff_cache' -o \
-name '.DS_Store'
SCHEMAS_FOLDER := vscode-ui/resources
STUBS_FOLDER := vscode-ui/src/stubs
install:
pip install -e .
install-dev-deps:
pip install pyright ruff
pip install mkdocs mkdocstrings[python] mkdocs-autolinks-plugin mkdocs-material mkdocs-glightbox
test:
pytest tests
clean-ignored:
find . \( $(TO_CLEAN) \) -exec rm -rf {} +
clean: clean-ignored
rm -rf build
rm -rf site
rm -rf tests/cache
rm -rf tests/cmd_out
make -C vscode-ui clean
make -C examples/libraries/why3py clean
make -C examples/why3 clean
make -C examples/mini_eqns clean
full-clean: clean
make -C examples/libraries/why3py full-clean
make -C examples/why3 full-clean
# Generate the demo file schema.
# This should only be executed after a change was made to the `Demo` type.
schemas:
mkdir -p $(SCHEMAS_FOLDER)
python -m delphyne.server.generate_schemas demo_file > \
$(SCHEMAS_FOLDER)/demo-schema.json
# Generate stubs by using GPT-4 to translate Python types into TypeScript.
# This should only be executed after a change is made to
# the `Demo` or `DemoFeedback` types
stubs:
python -m delphyne.server.generate_stubs demos > $(STUBS_FOLDER)/demos.ts
python -m delphyne.server.generate_stubs feedback > $(STUBS_FOLDER)/feedback.ts
all: install
make -C vscode-ui install
examples: all
make -C examples/libraries/why3py install
LOGOS_DIR := docs/assets/logos
BLACK_LOGOS := $(wildcard $(LOGOS_DIR)/black/*.png)
WHITE_LOGOS := $(subst /black/,/white/,$(BLACK_LOGOS))
$(LOGOS_DIR)/white/%.png: $(LOGOS_DIR)/black/%.png
convert $< -fill black -colorize 100% -channel RGB -negate +channel $@
doc-logo: $(WHITE_LOGOS)
deploy-doc:
mkdocs gh-deploy --force
# Count the number of lines of code
cloc:
cloc . --exclude-dir=node_modules,out,.vscode-test --include-lang=python,typescript