def minversion(module, version, inclusive=True, version_path=u'__version__'):
 if isinstance(module, types.ModuleType):
  module_name = module.__name__
 elif isinstance(module, six.string_types):
  module_name = module
  try:
   module = resolve_name(module_name)
  except ImportError:
   return False
 else:
  raise ValueError(u'module argument must be an actual imported module, or the import name of the module; got {0!r}'.format(module))
 if (u'.' not in version_path):
  have_version = getattr(module, version_path)
 else:
  have_version = resolve_name(module.__name__, version_path)
 try:
  from pkg_resources import parse_version
 except ImportError:
  from distutils.version import LooseVersion as parse_version
 if inclusive:
  return (parse_version(have_version) >= parse_version(version))
 else:
  return (parse_version(have_version) > parse_version(version))

def minversion ( module , version , inclusive = True , version_path = u'__version__' ) : if isinstance ( module , types . ModuleType ) : module_name = module . __name__ elif isinstance ( module , six . string_types ) : module_name = module try : module = resolve_name ( module_name ) except ImportError : return False else : raise ValueError ( u'module argument must be an actual imported module, or the import name of the module; got {0!r}' . format ( module ) ) if ( u'.' not in version_path ) : have_version = getattr ( module , version_path ) else : have_version = resolve_name ( module . __name__ , version_path ) try : from pkg_resources import parse_version except ImportError : from distutils . version import LooseVersion as parse_version if inclusive : return ( parse_version ( have_version ) >= parse_version ( version ) ) else : return ( parse_version ( have_version ) > parse_version ( version ) )
returns true if the specified python module satisfies a minimum version requirement .