-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_validate_init.py
More file actions
42 lines (34 loc) · 1.52 KB
/
Copy path_validate_init.py
File metadata and controls
42 lines (34 loc) · 1.52 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
"""Pre-deploy check: validate that all Python components have been generated.
Run after `npm run build` and before publishing / deploying. Confirms the
version, that every expected component wrapper exists, and that each is a real
Dash component class.
"""
import sys
import dash_mui_charts
EXPECTED = {
"BarChart", "CandlestickChart", "CompositeChart", "Heatmap", "LineChart",
"LiveTradingChart", "PieChart", "ScatterChart", "SimpleTreeView",
"SparklineChart", "TimeClock", "TreeView", "TreeViewPro",
}
if __name__ == "__main__":
print("dash_mui_charts version:", dash_mui_charts.__version__)
print("Components:", dash_mui_charts.__all__)
generated = set(dash_mui_charts.__all__)
missing = EXPECTED - generated
extra = generated - EXPECTED
if missing:
print(f"ERROR: missing component wrappers: {sorted(missing)}")
print("Run `npm run build` to regenerate the Python wrappers.")
sys.exit(1)
if extra:
# Not fatal, but flag it so EXPECTED stays in sync with the library.
print(f"NOTE: components present but not in EXPECTED set: {sorted(extra)}")
# Each name must resolve to an importable Dash component class.
for name in sorted(EXPECTED):
comp = getattr(dash_mui_charts, name, None)
if comp is None:
print(f"ERROR: {name} not importable from dash_mui_charts")
sys.exit(1)
print(f" {name}: OK")
print(f"\nValidation passed! {len(generated)} components, "
f"version {dash_mui_charts.__version__}.")