diff --git a/README.md b/README.md index 11d63c8..6d1a8e9 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ print(job.results['fasta']) Using the widget via Jupyter Notebook: ```jupyter -!pip install r2dt_client[widget] +!pip install r2dt_client from r2dt_client import setup, draw diff --git a/pyproject.toml b/pyproject.toml index 0efc416..970dd16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,8 @@ dependencies = [ "diskcache<6.0.0,>=5.6.3", "httpx<1.0.0,>=0.26.0", "yarl<2.0.0,>=1.9.4", + "ipython", + "ipywidgets", ] requires-python = ">=3.9,<4.0" readme = "README.md" @@ -24,12 +26,6 @@ Changelog = "https://github.com/anayden/r2dt-client/releases" homepage = "https://github.com/anayden/r2dt-client" repository = "https://github.com/anayden/r2dt-client" -[project.optional-dependencies] -widgets = [ - "ipython", - "ipywidgets", -] - [tool.pdm] package-type = "library" diff --git a/src/r2dt_client/widgets/widget.py b/src/r2dt_client/widgets/widget.py index 61b70a2..bfde8e4 100644 --- a/src/r2dt_client/widgets/widget.py +++ b/src/r2dt_client/widgets/widget.py @@ -1,15 +1,9 @@ import threading import time - -try: - from IPython.display import clear_output # type: ignore - from IPython.display import display # type: ignore - from ipywidgets import ValueWidget # type: ignore - - _HAS_IPYWIDGETS = True -except ImportError: - _HAS_IPYWIDGETS = False +from IPython.display import clear_output # type: ignore +from IPython.display import display # type: ignore +from ipywidgets import ValueWidget # type: ignore from r2dt_client import fetch_results_for from r2dt_client import submit @@ -37,15 +31,6 @@ def _display_svg(svg_content): def draw(sequence: str) -> None: - if not _HAS_IPYWIDGETS: - print( - "This function is only available in Jupyter Notebook and " - "after installing the library with 'pip install " - "r2dt_client[widgets]'\nConsider using standard API - submit, " - "update_status_for, fetch_results_for - instead." - ) - return - job = submit(sequence) spinner = _display_spinner()