Skip to content

Commit e1114ec

Browse files
authored
Print the total time to install (now that it is fast) (#220)
1 parent b9b3bc4 commit e1114ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

unidep/_cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import shutil
1717
import subprocess
1818
import sys
19+
import time
1920
from pathlib import Path
2021

2122
from unidep._conda_env import (
@@ -913,6 +914,7 @@ def _install_command( # noqa: PLR0912, PLR0915
913914
verbose: bool = False,
914915
) -> None:
915916
"""Install the dependencies of a single `requirements.yaml` or `pyproject.toml` file.""" # noqa: E501
917+
start_time = time.time()
916918
paths_with_extras = [parse_folder_or_filename(f) for f in files]
917919
requirements = parse_requirements(
918920
*[f.path for f in paths_with_extras],
@@ -1053,7 +1055,9 @@ def _install_command( # noqa: PLR0912, PLR0915
10531055
)
10541056

10551057
if not dry_run: # pragma: no cover
1056-
print("✅ All dependencies installed successfully.")
1058+
total_time = time.time() - start_time
1059+
msg = f"✅ All dependencies installed successfully in {total_time:.2f} seconds."
1060+
print(msg)
10571061

10581062

10591063
def _install_all_command(

0 commit comments

Comments
 (0)