mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 09:18:08 +02:00
Less output when building
This commit is contained in:
7
setup.py
7
setup.py
@@ -376,6 +376,7 @@ def parallel_run(items):
|
|||||||
items = list(reversed(items))
|
items = list(reversed(items))
|
||||||
workers = {}
|
workers = {}
|
||||||
failed = None
|
failed = None
|
||||||
|
num, total = 0, len(items)
|
||||||
|
|
||||||
def wait():
|
def wait():
|
||||||
nonlocal failed
|
nonlocal failed
|
||||||
@@ -391,16 +392,20 @@ def parallel_run(items):
|
|||||||
while items and failed is None:
|
while items and failed is None:
|
||||||
while len(workers) < num_workers and items:
|
while len(workers) < num_workers and items:
|
||||||
compile_cmd = items.pop()
|
compile_cmd = items.pop()
|
||||||
|
num += 1
|
||||||
if verbose:
|
if verbose:
|
||||||
print(' '.join(compile_cmd.cmd))
|
print(' '.join(compile_cmd.cmd))
|
||||||
else:
|
else:
|
||||||
print(compile_cmd.desc)
|
print('\r\x1b[K[{}/{}] {}'.format(num, total, compile_cmd.desc), end='')
|
||||||
w = subprocess.Popen(compile_cmd.cmd, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
w = subprocess.Popen(compile_cmd.cmd, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
||||||
workers[w.pid] = compile_cmd, w
|
workers[w.pid] = compile_cmd, w
|
||||||
wait()
|
wait()
|
||||||
while len(workers):
|
while len(workers):
|
||||||
wait()
|
wait()
|
||||||
|
if not verbose:
|
||||||
|
print()
|
||||||
if failed:
|
if failed:
|
||||||
|
print(failed.desc)
|
||||||
run_tool(failed.cmd)
|
run_tool(failed.cmd)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user