You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

4 years ago
  1. # This file is part of h5py, a Python interface to the HDF5 library.
  2. #
  3. # http://www.h5py.org
  4. #
  5. # Copyright 2008-2013 Andrew Collette and contributors
  6. #
  7. # License: Standard 3-clause BSD; see "license.txt" for full license terms
  8. # and contributor agreement.
  9. """
  10. Versioning module for h5py.
  11. """
  12. from __future__ import absolute_import
  13. from collections import namedtuple
  14. from . import h5 as _h5
  15. import sys
  16. import numpy
  17. # All should be integers, except pre, as validating versions is more than is
  18. # needed for our use case
  19. _H5PY_VERSION_CLS = namedtuple("_H5PY_VERSION_CLS",
  20. "major minor bugfix pre post dev")
  21. hdf5_built_version_tuple = _h5.HDF5_VERSION_COMPILED_AGAINST
  22. version_tuple = _H5PY_VERSION_CLS(2, 8, 0, None, None, None)
  23. version = "{0.major:d}.{0.minor:d}.{0.bugfix:d}".format(version_tuple)
  24. if version_tuple.pre is not None:
  25. version += version_tuple.pre
  26. if version_tuple.post is not None:
  27. version += ".post{0.post:d}".format(version_tuple)
  28. if version_tuple.dev is not None:
  29. version += ".dev{0.dev:d}".format(version_tuple)
  30. hdf5_version_tuple = _h5.get_libversion()
  31. hdf5_version = "%d.%d.%d" % hdf5_version_tuple
  32. api_version_tuple = (1,8)
  33. api_version = "%d.%d" % api_version_tuple
  34. info = """\
  35. Summary of the h5py configuration
  36. ---------------------------------
  37. h5py %(h5py)s
  38. HDF5 %(hdf5)s
  39. Python %(python)s
  40. sys.platform %(platform)s
  41. sys.maxsize %(maxsize)s
  42. numpy %(numpy)s
  43. """ % { 'h5py': version,
  44. 'hdf5': hdf5_version,
  45. 'python': sys.version,
  46. 'platform': sys.platform,
  47. 'maxsize': sys.maxsize,
  48. 'numpy': numpy.__version__ }