Skip to content

Commit

Permalink
Manually wrap pip errors to help remind users to install requirements…
Browse files Browse the repository at this point in the history
….txt
  • Loading branch information
rfbgo committed Jun 7, 2024
1 parent f7d2225 commit d81f65d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion lib/ramble/ramble/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ def walk(self):
node (GraphNode): Each node in the graph
"""
if not self._prepared:
sorter = graphlib.TopologicalSorter(self.adj_list)
try:
sorter = graphlib.TopologicalSorter(self.adj_list)
except AttributeError as e:
logger.die("graphlib.TopologicalSorter is not found. Ensure requirements.txt are installed (including backports, where needed).")

try:
self._sorted = tuple(sorter.static_order())
except graphlib.CycleError as e:
Expand Down
15 changes: 9 additions & 6 deletions lib/ramble/ramble/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,15 @@ def _execute(self):
or self.suppress_per_experiment_prints
)
if not disable_progress:
progress = tqdm.tqdm(
total=len(phase_list),
leave=True,
ascii=" >=",
bar_format="{l_bar}{bar}| Elapsed (s): {elapsed_s:.2f}",
)
try:
progress = tqdm.tqdm(
total=len(phase_list),
leave=True,
ascii=" >=",
bar_format="{l_bar}{bar}| Elapsed (s): {elapsed_s:.2f}",
)
except AttributeError:
logger.die("tdqm.tdqm is not found. Ensure requirements.txt are installed.")
for phase_idx, phase in enumerate(phase_list):
if not disable_progress:
progress.set_description(
Expand Down

0 comments on commit d81f65d

Please sign in to comment.