GeoEco.Dependencies.PythonModuleDependency

class GeoEco.Dependencies.PythonModuleDependency(importName, displayName=None, cheeseShopName=None, alternateURL=None, additionalMessage=None, logStdout=False)

Bases: Dependency

A Dependency that checks that a third-party Python module can be imported.

Parameters:
  • importName (str) – Name of the module, as it is imported, e.g. numpy. Minimum length꞉ 1.

  • displayName (str, optional) – Name of the module to display in messages about it, e.g. Python NumPy library. If not provided, Python importName module will be used, e.g. Python numpy module. Minimum length꞉ 1.

  • cheeseShopName (str, optional) – Name of the distribution package that appears on the Python Package Index. Minimum length꞉ 1.

  • alternateURL (str, optional) – Alternative URL where the module may be found found. Minimum length꞉ 1.

  • additionalMessage (str, optional) – Additional message to prepend to the debug message used to report a failure to import this module. Minimum length꞉ 1.

  • logStdout (bool, optional) – If True, messages printed to stdout when the module is imported will be logged to the GeoEco logging channel as debug messages.

Returns:

New PythonModuleDependency instance.

Return type:

PythonModuleDependency

Methods

GetConstraintDescriptionStrings

Returns the names of the software identified by this dependency, suitable to display to the user.

Initialize

Check that the given Python module can be imported.