Skip to content

Commit

Permalink
IPython Console: Drop support for Sympy less than 0.7.3
Browse files Browse the repository at this point in the history
Those versions are too old now
  • Loading branch information
ccordoba12 committed Mar 10, 2015
1 parent 9610faf commit dc8c372
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
2 changes: 1 addition & 1 deletion spyderlib/plugins/ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from spyderlib.py3compat import to_text_string


SYMPY_REQVER = '>=0.7.0'
SYMPY_REQVER = '>=0.7.3'
dependencies.add("sympy", _("Symbolic mathematics in the IPython Console"),
required_version=SYMPY_REQVER)

Expand Down
32 changes: 5 additions & 27 deletions spyderlib/widgets/externalshell/start_ipython_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,11 @@

def sympy_config():
"""Sympy configuration"""
from spyderlib.utils.programs import is_module_installed
lines_new = """
lines = """
from sympy.interactive import init_session
init_session()
"""
lines_old = """
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
"""
if is_module_installed('sympy', '>=0.7.3'):
extension = None
return lines_new, extension
elif is_module_installed('sympy', '=0.7.2'):
extension = 'sympy.interactive.ipythonprinting'
return lines_old, extension
elif is_module_installed('sympy', '>=0.7.0;<0.7.2'):
extension = 'sympyprinting'
return lines_old, extension
else:
return None, None
return lines


def kernel_config():
Expand Down Expand Up @@ -128,13 +110,9 @@ def kernel_config():
# Sympy loading
sympy_o = CONF.get('ipython_console', 'symbolic_math')
if sympy_o:
lines, extension = sympy_config()
if lines is not None:
spy_cfg.IPKernelApp.exec_lines.append(lines)
if extension:
spy_cfg.IPKernelApp.extra_extension = extension
spy_cfg.LaTeXTool.backends = ['dvipng', 'matplotlib']

lines = sympy_config()
spy_cfg.IPKernelApp.exec_lines.append(lines)

# Merge IPython and Spyder configs. Spyder prefs will have prevalence
# over IPython ones
ip_cfg._merge(spy_cfg)
Expand Down

0 comments on commit dc8c372

Please sign in to comment.