Skip to content

Commit

Permalink
Cleanup legacy ipython code; remove packaging and colorama as deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Jan 30, 2024
1 parent 5f75bf0 commit 01092cc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 181 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
---------

5.0.0 (unreleased)
5.0.0 (2024-01-09)
******************

Features:
Expand Down
18 changes: 2 additions & 16 deletions doitlive/ipython/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import packaging.version


def is_modern_ipython():
def start_ipython_player(commands, speed):
try:
import IPython
from doitlive.ipython.app import PlayerTerminalIPythonApp
except ImportError:
raise RuntimeError("ipython blocks require IPython to be installed")

return packaging.version.parse(IPython.__version__) >= packaging.version.parse(
"7.0.0"
)


def start_ipython_player(commands, speed):
if is_modern_ipython():
from doitlive.ipython.app import PlayerTerminalIPythonApp
else:
from doitlive.ipython.legacy_app import PlayerTerminalIPythonApp

PlayerTerminalIPythonApp.commands = commands
PlayerTerminalIPythonApp.speed = speed
PlayerTerminalIPythonApp.launch_instance()
159 changes: 0 additions & 159 deletions doitlive/ipython/legacy_app.py

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
"click>=8.0,<9",
"click-completion>=0.3.1",
"click-didyoumean>=0.0.3",
"packaging",
]

if "win32" in str(sys.platform).lower():
# Terminal colors for Windows
INSTALL_REQUIRES.append("colorama>=0.2.4")

EXTRAS_REQUIRE = {
"tests": ["pytest", "IPython"],
"lint": [
Expand Down

0 comments on commit 01092cc

Please sign in to comment.