Skip to content

Commit 9a65e64

Browse files
committed
Print installation time in ginstall
1 parent 0c5b105 commit 9a65e64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graalpython/lib-graalpython/modules/ginstall.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import subprocess
4747
import tempfile
4848
import importlib
49+
import time
4950

5051
import sys
5152

@@ -474,12 +475,14 @@ def _install_from_url(url, package, extra_opts=[], add_cflags="", ignore_errors=
474475
user_arg = ["--user"]
475476
else:
476477
user_arg = []
478+
start = time.time()
477479
status = run_cmd([sys.executable, "setup.py"] + build_cmd + ["install"] + user_arg + extra_opts, env=setup_env,
478480
cwd=os.path.join(tempdir, bare_name), quiet=quiet)
481+
end = time.time()
479482
if status != 0 and not ignore_errors:
480483
xit("An error occurred trying to run `setup.py install %s %s'" % (user_arg, " ".join(extra_opts)))
481484
elif quiet:
482-
info("{} successfully installed", package)
485+
info("{} successfully installed (took {:.2f} s)", package, (end - start))
483486

484487
# NOTE: Following 3 functions are duplicated in pip_hook.py:
485488
# creates a search list of a versioned file:

0 commit comments

Comments
 (0)