MCPcopy Index your code
hub / github.com/plotly/dash / bootstrap_components

Function bootstrap_components

dash/development/update_components.py:36–69  ·  view source on GitHub ↗
(components_source, concurrency, install_type)

Source from the content-addressed store, hash-verified

34
35
36def bootstrap_components(components_source, concurrency, install_type):
37
38 is_windows = sys.platform == "win32"
39
40 source_glob = (
41 components_source
42 if components_source != "all"
43 else "{dash-core-components,dash-html-components,dash-table}"
44 )
45
46 cmdstr = f"npx lerna exec --concurrency {concurrency} --scope='{source_glob}' -- npm {install_type}"
47 cmd = shlex.split(cmdstr, posix=not is_windows)
48 status_print(cmdstr)
49
50 with subprocess.Popen(
51 cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=is_windows
52 ) as proc:
53 out, err = proc.communicate()
54 status = proc.poll()
55
56 if err:
57 status_print(("🛑 " if status else "") + err.decode(), file=sys.stderr)
58
59 if status or not out:
60 status_print(
61 f"🚨 Failed installing npm dependencies for component packages: {source_glob} (status={status}) 🚨",
62 file=sys.stderr,
63 )
64 sys.exit(1)
65 else:
66 status_print(
67 f"🟢 Finished installing npm dependencies for component packages: {source_glob} 🟢",
68 file=sys.stderr,
69 )
70
71
72def build_components(components_source, concurrency):

Callers 1

cliFunction · 0.85

Calls 2

status_printFunction · 0.85
exitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…