##// END OF EJS Templates
bump minimum pyzmq version to 2.1.11...
MinRK -
Show More
@@ -23,10 +23,7 b' import zmq'
23 from IPython.config.configurable import MultipleInstanceError
23 from IPython.config.configurable import MultipleInstanceError
24 from IPython.zmq import check_for_zmq
24 from IPython.zmq import check_for_zmq
25
25
26 if os.name == 'nt':
26 min_pyzmq = '2.1.11'
27 min_pyzmq = '2.1.7'
28 else:
29 min_pyzmq = '2.1.4'
30
27
31 check_for_zmq(min_pyzmq, 'IPython.parallel')
28 check_for_zmq(min_pyzmq, 'IPython.parallel')
32
29
@@ -167,19 +167,9 b" have['wx'] = test_for('wx')"
167 have['wx.aui'] = test_for('wx.aui')
167 have['wx.aui'] = test_for('wx.aui')
168 have['azure'] = test_for('azure')
168 have['azure'] = test_for('azure')
169
169
170 if os.name == 'nt':
170 min_zmq = (2,1,11)
171 min_zmq = (2,1,7)
172 else:
173 min_zmq = (2,1,4)
174
175 def version_tuple(mod):
176 "turn '2.1.9' into (2,1,9), and '2.1dev' into (2,1,999)"
177 # turn 'dev' into 999, because Python3 rejects str-int comparisons
178 vs = mod.__version__.replace('dev', '.999')
179 tup = tuple([int(v) for v in vs.split('.') ])
180 return tup
181
171
182 have['zmq'] = test_for('zmq', min_zmq, version_tuple)
172 have['zmq'] = test_for('zmq.pyzmq_version_info', min_zmq)
183
173
184 #-----------------------------------------------------------------------------
174 #-----------------------------------------------------------------------------
185 # Functions and classes
175 # Functions and classes
@@ -6,11 +6,11 b''
6 #-----------------------------------------------------------------------------
6 #-----------------------------------------------------------------------------
7
7
8 #-----------------------------------------------------------------------------
8 #-----------------------------------------------------------------------------
9 # Verify zmq version dependency >= 2.1.4
9 # Verify zmq version dependency >= 2.1.11
10 #-----------------------------------------------------------------------------
10 #-----------------------------------------------------------------------------
11
11
12 import warnings
12 import warnings
13 from distutils.version import LooseVersion as V
13 from IPython.utils.version import check_version
14
14
15
15
16 def patch_pyzmq():
16 def patch_pyzmq():
@@ -21,22 +21,6 b' def patch_pyzmq():'
21
21
22 import zmq
22 import zmq
23
23
24 # ioloop.install, introduced in pyzmq 2.1.7
25 from zmq.eventloop import ioloop
26
27 def install():
28 import tornado.ioloop
29 tornado.ioloop.IOLoop = ioloop.IOLoop
30
31 if not hasattr(ioloop, 'install'):
32 ioloop.install = install
33
34 # fix missing DEALER/ROUTER aliases in pyzmq < 2.1.9
35 if not hasattr(zmq, 'DEALER'):
36 zmq.DEALER = zmq.XREQ
37 if not hasattr(zmq, 'ROUTER'):
38 zmq.ROUTER = zmq.XREP
39
40 # fallback on stdlib json if jsonlib is selected, because jsonlib breaks things.
24 # fallback on stdlib json if jsonlib is selected, because jsonlib breaks things.
41 # jsonlib support is removed from pyzmq >= 2.2.0
25 # jsonlib support is removed from pyzmq >= 2.2.0
42
26
@@ -54,17 +38,11 b" def check_for_zmq(minimum_version, module='IPython.zmq'):"
54
38
55 pyzmq_version = zmq.__version__
39 pyzmq_version = zmq.__version__
56
40
57 if 'dev' not in pyzmq_version and V(pyzmq_version) < V(minimum_version):
41 if not check_version(pyzmq_version, minimum_version):
58 raise ImportError("%s requires pyzmq >= %s, but you have %s"%(
42 raise ImportError("%s requires pyzmq >= %s, but you have %s"%(
59 module, minimum_version, pyzmq_version))
43 module, minimum_version, pyzmq_version))
60
44
61 if V(zmq.zmq_version()) >= V('4.0.0'):
45 check_for_zmq('2.1.11')
62 warnings.warn("""libzmq 4 detected.
63 It is unlikely that IPython's zmq code will work properly.
64 Please install libzmq stable, which is 2.1.x or 2.2.x""",
65 RuntimeWarning)
66
67 check_for_zmq('2.1.4')
68 patch_pyzmq()
46 patch_pyzmq()
69
47
70 from .blockingkernelmanager import BlockingKernelManager
48 from .blockingkernelmanager import BlockingKernelManager
@@ -229,12 +229,12 b" if 'setuptools' in sys.modules:"
229 setuptools_extra_args['zip_safe'] = False
229 setuptools_extra_args['zip_safe'] = False
230 setuptools_extra_args['entry_points'] = find_scripts(True)
230 setuptools_extra_args['entry_points'] = find_scripts(True)
231 setup_args['extras_require'] = dict(
231 setup_args['extras_require'] = dict(
232 parallel = 'pyzmq>=2.1.4',
232 parallel = 'pyzmq>=2.1.11',
233 qtconsole = ['pyzmq>=2.1.4', 'pygments'],
233 qtconsole = ['pyzmq>=2.1.11', 'pygments'],
234 zmq = 'pyzmq>=2.1.4',
234 zmq = 'pyzmq>=2.1.11',
235 doc = 'Sphinx>=0.3',
235 doc = 'Sphinx>=0.3',
236 test = 'nose>=0.10.1',
236 test = 'nose>=0.10.1',
237 notebook = ['tornado>=2.0', 'pyzmq>=2.1.4', 'jinja2'],
237 notebook = ['tornado>=2.0', 'pyzmq>=2.1.11', 'jinja2'],
238 )
238 )
239 requires = setup_args.setdefault('install_requires', [])
239 requires = setup_args.setdefault('install_requires', [])
240 setupext.display_status = False
240 setupext.display_status = False
@@ -142,23 +142,13 b' def check_for_pyzmq():'
142 else:
142 else:
143 # pyzmq 2.1.10 adds pyzmq_version_info funtion for returning
143 # pyzmq 2.1.10 adds pyzmq_version_info funtion for returning
144 # version as a tuple
144 # version as a tuple
145 if hasattr(zmq, 'pyzmq_version_info'):
145 if hasattr(zmq, 'pyzmq_version_info') and zmq.pyzmq_version_info() >= (2,1,11):
146 if zmq.pyzmq_version_info() >= (2,1,4):
147 print_status("pyzmq", zmq.__version__)
146 print_status("pyzmq", zmq.__version__)
148 return True
147 return True
149 else:
148 else:
150 # this branch can never occur, at least until we update our
149 print_status('pyzmq', "no (have %s, but require >= 2.1.11 for"
151 # pyzmq dependency beyond 2.1.10
150 " qtconsole, notebook, and parallel computing capabilities)" % zmq.__version__)
152 return False
151 return False
153 # this is necessarily earlier than 2.1.10, so string comparison is
154 # okay
155 if zmq.__version__ < '2.1.4':
156 print_status('pyzmq', "no (have %s, but require >= 2.1.4 for"
157 " qtconsole and parallel computing capabilities)"%zmq.__version__)
158 return False
159 else:
160 print_status("pyzmq", zmq.__version__)
161 return True
162
152
163 def check_for_readline():
153 def check_for_readline():
164 from distutils.version import LooseVersion
154 from distutils.version import LooseVersion
General Comments 0
You need to be logged in to leave comments. Login now