@@ -20,7 +20,7 @@ class _CombinedFormatter(
20
20
)
21
21
22
22
23
- def booststrap_components (components_source ):
23
+ def bootstrap_components (components_source , concurrency ):
24
24
25
25
is_windows = sys .platform == "win32"
26
26
@@ -30,10 +30,9 @@ def booststrap_components(components_source):
30
30
else "dash-core-components|dash-html-components|dash-table"
31
31
)
32
32
33
- cmd = shlex .split (
34
- "npx lerna exec --scope *@({})* -- npm i" .format (source_glob ),
35
- posix = not is_windows ,
36
- )
33
+ cmdstr = f"npx lerna exec --concurrency { concurrency } --scope *@({ source_glob } )* -- npm i"
34
+ cmd = shlex .split (cmdstr , posix = not is_windows )
35
+ print (cmdstr )
37
36
38
37
with subprocess .Popen (
39
38
cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = is_windows
@@ -57,7 +56,7 @@ def booststrap_components(components_source):
57
56
)
58
57
59
58
60
- def build_components (components_source ):
59
+ def build_components (components_source , concurrency ):
61
60
62
61
is_windows = sys .platform == "win32"
63
62
@@ -67,10 +66,9 @@ def build_components(components_source):
67
66
else "dash-core-components|dash-html-components|dash-table"
68
67
)
69
68
70
- cmd = shlex .split (
71
- "npx lerna exec --scope *@({})* -- npm run build" .format (source_glob ),
72
- posix = not is_windows ,
73
- )
69
+ cmdstr = f"npx lerna exec --concurrency { concurrency } --scope *@({ source_glob } )* -- npm run build"
70
+ cmd = shlex .split (cmdstr , posix = not is_windows )
71
+ print (cmdstr )
74
72
75
73
with subprocess .Popen (
76
74
cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE , shell = is_windows
@@ -140,11 +138,17 @@ def cli():
140
138
" The default argument is 'all'." ,
141
139
default = "all" ,
142
140
)
141
+ parser .add_argument (
142
+ "--concurrency" ,
143
+ type = int ,
144
+ default = 3 ,
145
+ help = "Maximum concurrent steps, up to 3 (ie all components in parallel)" ,
146
+ )
143
147
144
148
args = parser .parse_args ()
145
149
146
- booststrap_components (args .components_source )
147
- build_components (args .components_source )
150
+ bootstrap_components (args .components_source , args . concurrency )
151
+ build_components (args .components_source , args . concurrency )
148
152
149
153
150
154
if __name__ == "__main__" :
0 commit comments