-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (64 loc) · 1.8 KB
/
Makefile
File metadata and controls
82 lines (64 loc) · 1.8 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
# Manage plotly.py project.
RUN = uv run
PACKAGE_DIRS = _plotly_utils plotly
CODE_DIRS = ${PACKAGE_DIRS} scripts
EXAMPLE_SRC = $(wildcard doc/python/*.md)
EXAMPLE_DST = $(patsubst doc/python/%.md,pages/%.md,${EXAMPLE_SRC})
## commands: show available commands
commands:
@grep -h -E '^##' ${MAKEFILE_LIST} | sed -e 's/## //g' | column -t -s ':'
## docs: rebuild documentation
.PHONY: docs
docs:
${RUN} mkdocs build
## docs-lint: check documentation
docs-lint:
${RUN} pydoclint ${PACKAGE_DIRS}
## docs-tmp: rebuild documentation saving Markdown in ./tmp
docs-tmp:
MKDOCS_TEMP_DIR=./docs_tmp ${RUN} mkdocs build
## examples: generate Markdown for individual doc/python
examples: ${EXAMPLE_DST}
pages/%.md: doc/python/%.md
@mkdir -p pages/examples
@${RUN} bin/run_markdown.py --outdir pages --htmldir pages/examples --inline --verbose 1 $<
## examples-force: force complete rebuild of examples
examples-force:
@touch ${EXAMPLE_SRC}
@make examples
## examples-toc: generate YAML table of contents for examples
examples-toc:
@python bin/build_example_toc.py ${EXAMPLE_SRC}
## format: reformat code
format:
${RUN} ruff format ${CODE_DIRS}
## generate: generate code
generate:
${RUN} bin/generate_code.py --codedir plotly
${RUN} ruff format plotly
## generate reference markdown files
reference:
${RUN} bin/generate_graph_objects_docs.py
## lint: check the code
lint:
${RUN} ruff check ${CODE_DIRS}
## test: run tests
test:
${RUN} pytest tests
## updatejs: update JavaScript bundle
updatejs:
${RUN} bin/updatejs.py --codedir plotly
## --: --
## clean: clean up repository
clean:
@find . -name '*~' -delete
@find . -name '.DS_Store' -delete
@rm -rf .coverage
@rm -rf .pytest_cache
@rm -rf .ruff_cache
@rm -rf dist
@rm -rf docs
@rm -rf pages/examples
## sync: update Python packages
sync:
uv sync --extra dev