diff --git a/IPython/parallel/__init__.py b/IPython/parallel/__init__.py index 511e10d..ac6161f 100644 --- a/IPython/parallel/__init__.py +++ b/IPython/parallel/__init__.py @@ -23,10 +23,7 @@ import zmq from IPython.config.configurable import MultipleInstanceError from IPython.zmq import check_for_zmq -if os.name == 'nt': - min_pyzmq = '2.1.7' -else: - min_pyzmq = '2.1.4' +min_pyzmq = '2.1.11' check_for_zmq(min_pyzmq, 'IPython.parallel') diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index 100f8ea..6b5d6f4 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -167,19 +167,9 @@ have['wx'] = test_for('wx') have['wx.aui'] = test_for('wx.aui') have['azure'] = test_for('azure') -if os.name == 'nt': - min_zmq = (2,1,7) -else: - min_zmq = (2,1,4) - -def version_tuple(mod): - "turn '2.1.9' into (2,1,9), and '2.1dev' into (2,1,999)" - # turn 'dev' into 999, because Python3 rejects str-int comparisons - vs = mod.__version__.replace('dev', '.999') - tup = tuple([int(v) for v in vs.split('.') ]) - return tup - -have['zmq'] = test_for('zmq', min_zmq, version_tuple) +min_zmq = (2,1,11) + +have['zmq'] = test_for('zmq.pyzmq_version_info', min_zmq) #----------------------------------------------------------------------------- # Functions and classes diff --git a/IPython/zmq/__init__.py b/IPython/zmq/__init__.py index fd40150..230d221 100644 --- a/IPython/zmq/__init__.py +++ b/IPython/zmq/__init__.py @@ -6,11 +6,11 @@ #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- -# Verify zmq version dependency >= 2.1.4 +# Verify zmq version dependency >= 2.1.11 #----------------------------------------------------------------------------- import warnings -from distutils.version import LooseVersion as V +from IPython.utils.version import check_version def patch_pyzmq(): @@ -21,22 +21,6 @@ def patch_pyzmq(): import zmq - # ioloop.install, introduced in pyzmq 2.1.7 - from zmq.eventloop import ioloop - - def install(): - import tornado.ioloop - tornado.ioloop.IOLoop = ioloop.IOLoop - - if not hasattr(ioloop, 'install'): - ioloop.install = install - - # fix missing DEALER/ROUTER aliases in pyzmq < 2.1.9 - if not hasattr(zmq, 'DEALER'): - zmq.DEALER = zmq.XREQ - if not hasattr(zmq, 'ROUTER'): - zmq.ROUTER = zmq.XREP - # fallback on stdlib json if jsonlib is selected, because jsonlib breaks things. # jsonlib support is removed from pyzmq >= 2.2.0 @@ -54,17 +38,11 @@ def check_for_zmq(minimum_version, module='IPython.zmq'): pyzmq_version = zmq.__version__ - if 'dev' not in pyzmq_version and V(pyzmq_version) < V(minimum_version): + if not check_version(pyzmq_version, minimum_version): raise ImportError("%s requires pyzmq >= %s, but you have %s"%( module, minimum_version, pyzmq_version)) - if V(zmq.zmq_version()) >= V('4.0.0'): - warnings.warn("""libzmq 4 detected. - It is unlikely that IPython's zmq code will work properly. - Please install libzmq stable, which is 2.1.x or 2.2.x""", - RuntimeWarning) - -check_for_zmq('2.1.4') +check_for_zmq('2.1.11') patch_pyzmq() from .blockingkernelmanager import BlockingKernelManager diff --git a/setup.py b/setup.py index d0386ec..5c36e29 100755 --- a/setup.py +++ b/setup.py @@ -229,12 +229,12 @@ if 'setuptools' in sys.modules: setuptools_extra_args['zip_safe'] = False setuptools_extra_args['entry_points'] = find_scripts(True) setup_args['extras_require'] = dict( - parallel = 'pyzmq>=2.1.4', - qtconsole = ['pyzmq>=2.1.4', 'pygments'], - zmq = 'pyzmq>=2.1.4', + parallel = 'pyzmq>=2.1.11', + qtconsole = ['pyzmq>=2.1.11', 'pygments'], + zmq = 'pyzmq>=2.1.11', doc = 'Sphinx>=0.3', test = 'nose>=0.10.1', - notebook = ['tornado>=2.0', 'pyzmq>=2.1.4', 'jinja2'], + notebook = ['tornado>=2.0', 'pyzmq>=2.1.11', 'jinja2'], ) requires = setup_args.setdefault('install_requires', []) setupext.display_status = False diff --git a/setupext/setupext.py b/setupext/setupext.py index 50d2144..b2f824e 100644 --- a/setupext/setupext.py +++ b/setupext/setupext.py @@ -142,23 +142,13 @@ def check_for_pyzmq(): else: # pyzmq 2.1.10 adds pyzmq_version_info funtion for returning # version as a tuple - if hasattr(zmq, 'pyzmq_version_info'): - if zmq.pyzmq_version_info() >= (2,1,4): + if hasattr(zmq, 'pyzmq_version_info') and zmq.pyzmq_version_info() >= (2,1,11): print_status("pyzmq", zmq.__version__) return True - else: - # this branch can never occur, at least until we update our - # pyzmq dependency beyond 2.1.10 - return False - # this is necessarily earlier than 2.1.10, so string comparison is - # okay - if zmq.__version__ < '2.1.4': - print_status('pyzmq', "no (have %s, but require >= 2.1.4 for" - " qtconsole and parallel computing capabilities)"%zmq.__version__) - return False else: - print_status("pyzmq", zmq.__version__) - return True + print_status('pyzmq', "no (have %s, but require >= 2.1.11 for" + " qtconsole, notebook, and parallel computing capabilities)" % zmq.__version__) + return False def check_for_readline(): from distutils.version import LooseVersion