version.py revision 781d71db
1"""PyZMQ and 0MQ version functions."""
2
3# Copyright (C) PyZMQ Developers
4# Distributed under the terms of the Modified BSD License.
5
6
7from zmq.backend import zmq_version_info
8
9
10VERSION_MAJOR = 14
11VERSION_MINOR = 5
12VERSION_PATCH = 0
13VERSION_EXTRA = ""
14__version__ = '%i.%i.%i' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
15
16if VERSION_EXTRA:
17    __version__ = "%s-%s" % (__version__, VERSION_EXTRA)
18    version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, float('inf'))
19else:
20    version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
21
22__revision__ = ''
23
24def pyzmq_version():
25    """return the version of pyzmq as a string"""
26    if __revision__:
27        return '@'.join([__version__,__revision__[:6]])
28    else:
29        return __version__
30
31def pyzmq_version_info():
32    """return the pyzmq version as a tuple of at least three numbers
33
34    If pyzmq is a development version, `inf` will be appended after the third integer.
35    """
36    return version_info
37
38
39def zmq_version():
40    """return the version of libzmq as a string"""
41    return "%i.%i.%i" % zmq_version_info()
42
43
44__all__ = ['zmq_version', 'zmq_version_info',
45           'pyzmq_version','pyzmq_version_info',
46           '__version__', '__revision__'
47]
48
49