minversion

astropy.utils.introspection.minversion(module, version, inclusive=True, version_path='__version__')[source]

Returns True if the specified Python module satisfies a minimum version requirement, and False if not.

Deprecated since version ``version_path``: is not used anymore and is deprecated in astropy 5.0.

Parameters:
modulepython:module or str

An imported module of which to check the version, or the name of that module (in which case an import of that module is attempted– if this fails False is returned).

versionstr

The version as a string that this module must have at a minimum (e.g. '0.12').

inclusivebool

The specified version meets the requirement inclusively (i.e. >=) as opposed to strictly greater than (default: True).

Examples

>>> import astropy
>>> minversion(astropy, '0.4.4')
True