Skip to content

Commit

Permalink
chore(shell): ruff 0.4.7 autofixes
Browse files Browse the repository at this point in the history
❯ ruff check . --fix --show-fixes
src/tmuxp/shell.py:54:29: F401 `IPython.start_ipython` imported but unused; consider using `importlib.util.find_spec` to test for availability
src/tmuxp/shell.py:57:39: F401 `IPython.Shell.IPShell` imported but unused; consider using `importlib.util.find_spec` to test for availability
src/tmuxp/shell.py:70:53: F401 `prompt_toolkit.contrib.repl.embed` imported but unused; consider using `importlib.util.find_spec` to test for availability
src/tmuxp/shell.py:70:60: F401 `prompt_toolkit.contrib.repl.run_config` imported but unused; consider using `importlib.util.find_spec` to test for availability
src/tmuxp/shell.py:84:56: F401 `prompt_toolkit.contrib.ipython.embed` imported but unused; consider using `importlib.util.find_spec` to test for availability
src/tmuxp/shell.py:85:53: F401 `prompt_toolkit.contrib.repl.run_config` imported but unused; consider using `importlib.util.find_spec` to test for availability
src/tmuxp/shell.py:95:29: F401 `bpython.embed` imported but unused; consider using `importlib.util.find_spec` to test for availability

Fixed 6 errors:
- src/tmuxp/shell.py:
    6 × RUF100 (unused-noqa)
  • Loading branch information
tony committed Jun 1, 2024
1 parent b8258a3 commit a86d088
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tmuxp/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class LaunchImports(t.TypedDict):
def has_ipython() -> bool:
"""Return True if ipython is installed."""
try:
from IPython import start_ipython # NOQA: F841
from IPython import start_ipython
except ImportError:
try:
from IPython.Shell import IPShell # NOQA: F841
from IPython.Shell import IPShell
except ImportError:
return False

Expand All @@ -67,7 +67,7 @@ def has_ptpython() -> bool:
from ptpython.repl import embed, run_config # F841
except ImportError:
try:
from prompt_toolkit.contrib.repl import embed, run_config # NOQA: F841
from prompt_toolkit.contrib.repl import embed, run_config
except ImportError:
return False

Expand All @@ -81,8 +81,8 @@ def has_ptipython() -> bool:
from ptpython.repl import run_config # F841
except ImportError:
try:
from prompt_toolkit.contrib.ipython import embed # NOQA: F841
from prompt_toolkit.contrib.repl import run_config # NOQA: F841
from prompt_toolkit.contrib.ipython import embed
from prompt_toolkit.contrib.repl import run_config
except ImportError:
return False

Expand All @@ -92,7 +92,7 @@ def has_ptipython() -> bool:
def has_bpython() -> bool:
"""Return True if bpython is installed."""
try:
from bpython import embed # NOQA: F841
from bpython import embed
except ImportError:
return False
return True
Expand Down

0 comments on commit a86d088

Please sign in to comment.