Skip to content

Commit 75b0e33

Browse files
author
Wu Jianxiao
committed
Only require user to have Ipython installed for using the ipython debugger
1 parent 3358a40 commit 75b0e33

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pydra/scripts/cli.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import pdb
33
import sys
44

5-
from IPython.core import ultratb
65
import click
76
import cloudpickle as cp
87

@@ -40,9 +39,16 @@ def crash(crashfile, rerun, debugger=None):
4039
job_obj = cp.load(f)
4140

4241
if debugger == "ipython":
43-
sys.excepthook = ultratb.FormattedTB(
44-
mode="Verbose", theme_name="Linux", call_pdb=True
45-
)
42+
try:
43+
from IPython.core import ultratb
44+
45+
sys.excepthook = ultratb.FormattedTB(
46+
mode="Verbose", theme_name="Linux", call_pdb=True
47+
)
48+
except ImportError:
49+
raise ImportError(
50+
"'Ipython' needs to be installed to use the 'ipython' debugger"
51+
)
4652

4753
try:
4854
job_obj.run(rerun=True)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies = [
1414
"filelock >=3.0.0",
1515
"fileformats >=0.15.0a7",
1616
"platformdirs >=2",
17-
"ipython",
1817
]
1918
license = { file = "LICENSE" }
2019
authors = [{ name = "Nipype developers", email = "[email protected]" }]
@@ -44,6 +43,7 @@ doc = [
4443
"fileformats-medimage >= v0.10.0a2",
4544
"fileformats-medimage-extras >= v0.10.0a2",
4645
"furo>=2022.2.14.1",
46+
"ipython",
4747
"ipykernel",
4848
"ipywidgets",
4949
"matplotlib",

0 commit comments

Comments
 (0)