Skip to content

Commit

Permalink
build!: move ipython/repl functionality to optional dependency group
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jun 13, 2024
1 parent c4e620b commit 2da926c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dynamic = ["version"]
dependencies = [
"bioutils > 0.4",
"coloredlogs ~= 15.0",
"ipython ~= 8.4",
"pysam ~= 0.22",
"requests ~= 2.31",
"six ~= 1.16",
Expand All @@ -28,12 +27,14 @@ dependencies = [
]

[project.optional-dependencies]
shell = [
"ipython ~= 8.4",
]
dev = [
"bandit ~= 1.7",
"black ~= 22.3",
"build ~= 0.8",
"flake8 ~= 4.0",
"ipython ~= 8.4",
"isort ~= 5.10",
"mypy-extensions ~= 1.0",
"pre-commit ~= 3.4",
Expand Down
6 changes: 5 additions & 1 deletion src/biocommons/seqrepo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,11 @@ def _drop_write(p):
def start_shell(opts: argparse.Namespace) -> None:
seqrepo_dir = os.path.join(opts.root_directory, opts.instance_name)
sr = SeqRepo(seqrepo_dir) # noqa: 682
import IPython
try:
import IPython
except ImportError as e:
msg = "Unable to import IPython to start SeqRepo shell. Is the `shell` dependency group installed?" # noqa: E501
raise ImportError(msg) from e

IPython.embed(
header="\n".join(
Expand Down

0 comments on commit 2da926c

Please sign in to comment.