33import warnings
44from collections .abc import Iterable
55from functools import lru_cache , partial
6+ from importlib .metadata import version
67from importlib .util import find_spec
78from itertools import product
89from os import mkdir
@@ -3123,6 +3124,11 @@ def environment(display=True, paths=True):
31233124 "cartopy" : _get_module_info ("cartopy" , try_except = True ),
31243125 "cfplot" : _get_module_info ("cfplot" , try_except = True ),
31253126 "cf" : (__version__ , _os_path_abspath (__file__ )),
3127+ # Healpix module doesn't define a __version__, so can't as standard use
3128+ # _get_module_info, but I have opened an Issue with them to define
3129+ # this (see: https://github.com/ntessore/healpix/issues/108)
3130+ "healpix" : (version ("healpix" ), find_spec ("healpix" ).origin ),
3131+ "pyproj" : _get_module_info ("pyproj" , try_except = True ),
31263132 }
31273133 string = "{0}: {1!s}"
31283134 if paths :
@@ -3136,6 +3142,12 @@ def environment(display=True, paths=True):
31363142 ]
31373143 )
31383144
3145+ # There are a lot of dependencies (compulsory + optional) to print so
3146+ # show them in asciibetical order, with the happy coincidence that the
3147+ # 'cf*' libraries, 'Platform' and 'Python' still come near the top (the
3148+ # (latter because of the capitalisation) so are easy to pick out.
3149+ out .sort ()
3150+
31393151 if display :
31403152 print ("\n " .join (out )) # pragma: no cover
31413153 else :
0 commit comments