-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathMakefile
More file actions
190 lines (156 loc) · 6.96 KB
/
Copy pathMakefile
File metadata and controls
190 lines (156 loc) · 6.96 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
PYTHON ?= .venv/bin/python
CHROMIUM ?=
UV_CACHE_DIR ?= /tmp/xy_uv_cache
WHEEL_EXPECT ?=
SDIST ?=
WHEEL ?=
BENCHMARK_JSON ?= benchmark.json
BENCHMARK_KIND ?= auto
NAME ?=
# The release tool, pinned to the same version as `cli-command` in
# [tool.reflex-release] — keep the two together, or a local `make news` and the
# release workflows would run different pipelines. Installed into a throwaway
# environment, so the tool is never a dependency of the dev venv.
RELEASE_VERSION ?= 0.1.0a4
RELEASE_CLI = uvx reflex-release@$(RELEASE_VERSION)
.PHONY: help setup setup-browser check check-full check-browser check-conformance check-docs check-examples check-security check-errors check-api check-import check-ci check-benchmark-harness check-pyplot check-pyplot-speed check-sdist check-wheel check-artifacts check-benchmark-report list-checks test lint format typecheck public-api python-floor js-check rust-check abi-smoke news news-check
help:
@printf '%s\n' \
'xy developer shortcuts' \
'' \
' make setup create .venv, install the dev group, and build the native core' \
' make setup-browser install the pinned Playwright browser-test driver' \
' make check run the fast local verification gate' \
' make check-full run JS, Rust, and ABI gates too' \
' make check-browser run browser smokes (set CHROMIUM=/path/to/chrome)' \
' make check-conformance run accessibility + Chromium/Firefox/WebKit conformance' \
' make check-docs run documentation examples' \
' make check-examples run canonical API examples and Reflex asset registry checks' \
' make check-security run standalone HTML safety and client text-sink checks' \
' make check-errors run public error, LOD, and mutation-safety tests' \
' make check-api run lazy public API and type-surface checks' \
' make check-import run import-time and dependency-boundary checks' \
' make check-ci run CI and CodSpeed workflow invariant checks' \
' make check-benchmark-harness run benchmark metadata/report/regression tests' \
' make check-pyplot run the matplotlib-shim suite and compatibility corpus' \
' make check-pyplot-speed enforce the per-family 10x static-PNG target (requires matplotlib)' \
' make check-sdist build and verify the source distribution' \
' make check-wheel build and verify a wheel (set WHEEL_EXPECT=--expect-native)' \
' make check-artifacts verify prebuilt artifacts (set SDIST=... WHEEL=...)' \
' make check-benchmark-report validate BENCHMARK_JSON (scatter-vs, pyplot-vs-matplotlib, line-decimation, install-footprint, core-2d, scatter-native, heatmap-native, kernel-native, interaction-browser, dashboard-browser, workflow-native)' \
' override UV_CACHE_DIR if your uv cache lives elsewhere' \
' make list-checks list verifier check names' \
' make news NAME=1234.feature.md add a changelog news fragment' \
' make news-check check this branch against main for a required fragment' \
' make test run pytest' \
' make lint run ruff check' \
' make format run ruff format --check' \
' make typecheck run ty over the shippable package' \
' make js-check build the render client from source' \
' make rust-check run cargo test and clippy'
setup:
uv sync --extra reflex --group dev
cargo build --release
setup-browser:
npm install
check:
$(PYTHON) scripts/verify_local.py --quick
check-full:
$(PYTHON) scripts/verify_local.py --full
check-browser:
@if [ -z "$(CHROMIUM)" ]; then \
echo 'Set CHROMIUM=/path/to/chrome for browser smoke checks.' >&2; \
exit 2; \
fi
@node -e "require.resolve('playwright')" >/dev/null 2>&1 || { \
echo 'Playwright is required for the standalone worker probe. Run: make setup-browser' >&2; \
exit 2; \
}
$(PYTHON) scripts/verify_local.py --browser --chromium "$(CHROMIUM)"
check-conformance:
@node -e "require.resolve('playwright')" >/dev/null 2>&1 || { \
echo 'Playwright is required. Run: make setup-browser && npx playwright install chromium firefox webkit' >&2; \
exit 2; \
}
node scripts/browser_conformance.mjs
check-docs:
$(PYTHON) scripts/verify_local.py --only examples
check-examples:
$(PYTHON) scripts/verify_local.py --only examples
check-pyplot:
$(PYTHON) -m pytest tests/pyplot -q
check-security:
$(PYTHON) scripts/verify_local.py --only security_export
check-errors:
$(PYTHON) scripts/verify_local.py --only error_safety
check-api:
$(PYTHON) scripts/verify_local.py --only public_api,api_surface
check-import:
$(PYTHON) scripts/verify_local.py --only public_api,import_budget
check-ci:
$(PYTHON) scripts/verify_local.py --only ci_workflow
check-benchmark-harness:
$(PYTHON) scripts/verify_local.py --only benchmark_harness
check-pyplot-speed:
PYTHONPATH=python $(PYTHON) benchmarks/bench_pyplot_vs_matplotlib.py \
--profile standard --reps 21 --warmups 3 --target-speedup 10 --require-target
check-sdist:
@set -e; \
OUT=$$(mktemp -d); \
echo "building sdist in $$OUT"; \
UV_CACHE_DIR="$(UV_CACHE_DIR)" uv build --sdist --out-dir "$$OUT"; \
$(PYTHON) scripts/verify_sdist.py "$$OUT"/xy-*.tar.gz
check-wheel:
@set -e; \
OUT=$$(mktemp -d); \
echo "building wheel in $$OUT"; \
UV_CACHE_DIR="$(UV_CACHE_DIR)" uv build --wheel --out-dir "$$OUT"; \
$(PYTHON) scripts/verify_wheel.py "$$OUT"/xy-*.whl $(WHEEL_EXPECT)
check-artifacts:
@if [ -z "$(SDIST)" ]; then \
echo 'Set SDIST=/path/to/xy.tar.gz for artifact verification.' >&2; \
exit 2; \
fi
@if [ -z "$(WHEEL)" ]; then \
echo 'Set WHEEL=/path/to/xy.whl for artifact verification.' >&2; \
exit 2; \
fi
$(PYTHON) scripts/verify_local.py --packaging --sdist "$(SDIST)" --wheel "$(WHEEL)" $(WHEEL_EXPECT)
check-benchmark-report:
$(PYTHON) scripts/verify_benchmark_report.py "$(BENCHMARK_JSON)" --kind "$(BENCHMARK_KIND)"
list-checks:
$(PYTHON) scripts/verify_local.py --list
# Every user-visible change lands a news fragment; the release pipeline
# materializes the pending ones into CHANGELOG.md. Types: breaking,
# deprecation, feature, bugfix, performance, docs, misc. Before you know the PR
# number, name it `+something.feature.md` and rename it later.
news:
@if [ -z "$(NAME)" ]; then \
echo 'Set NAME=<pr-number>.<type>.md, e.g. make news NAME=1234.feature.md' >&2; \
exit 2; \
fi
$(RELEASE_CLI) create "$(NAME)"
# Defaults to the main branch, which is where nearly every pull request lands;
# override for a prerelease or hotfix branch (BASE_REF=origin/r/hotfix/0.1) so it
# diffs the same base the pull request does.
news-check:
BASE_REF="$${BASE_REF:-origin/main}" $(RELEASE_CLI) changelog-check
test:
$(PYTHON) -m pytest -q
lint:
$(PYTHON) -m ruff check .
format:
$(PYTHON) -m ruff format --check .
typecheck:
$(PYTHON) -m ty check python
public-api:
$(PYTHON) scripts/check_public_api.py
python-floor:
$(PYTHON) scripts/check_python_floor.py
js-check:
node js/build.mjs
rust-check:
cargo test
cargo clippy --all-targets -- -D warnings
abi-smoke:
$(PYTHON) scripts/abi_smoke.py