(components_source, concurrency, install_type)
| 34 | |
| 35 | |
| 36 | def 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 | |
| 72 | def build_components(components_source, concurrency): |
no test coverage detected
searching dependent graphs…