version.py 1.2 KB

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