##// END OF EJS Templates
Cleaner minimum version comparison using setuptools to reduce chance of breakage (0.11 broke with pyzmq 2.1.10)
Szabolcs Horvát -
Show More
@@ -9,21 +9,18 b''
9 9 # Verify zmq version dependency >= 2.1.4
10 10 #-----------------------------------------------------------------------------
11 11
12 import re
13 12 import warnings
13 from pkg_resources import parse_version as V
14 14
15 15 def check_for_zmq(minimum_version, module='IPython.zmq'):
16 min_vlist = [int(n) for n in minimum_version.split('.')]
17
18 16 try:
19 17 import zmq
20 18 except ImportError:
21 19 raise ImportError("%s requires pyzmq >= %s"%(module, minimum_version))
22 20
23 21 pyzmq_version = zmq.__version__
24 vlist = [int(n) for n in re.findall(r'\d+', pyzmq_version)]
25
26 if 'dev' not in pyzmq_version and vlist < min_vlist:
22
23 if V(pyzmq_version) < V(minimum_version):
27 24 raise ImportError("%s requires pyzmq >= %s, but you have %s"%(
28 25 module, minimum_version, pyzmq_version))
29 26
@@ -33,7 +30,7 b" def check_for_zmq(minimum_version, module='IPython.zmq'):"
33 30 if not hasattr(zmq, 'ROUTER'):
34 31 zmq.ROUTER = zmq.XREP
35 32
36 if zmq.zmq_version() >= '4.0.0':
33 if V(zmq.zmq_version()) >= V('4.0.0'):
37 34 warnings.warn("""libzmq 4 detected.
38 35 It is unlikely that IPython's zmq code will work properly.
39 36 Please install libzmq stable, which is 2.1.x or 2.2.x""",
General Comments 0
You need to be logged in to leave comments. Login now