locan.dependencies¶
Module to deal with required and optional dependencies.
Optional dependencies are defined in pyproject.toml.
In any module that requires an optional dependency the import should be conditioned:
if HAS_DEPENDENCY[“package”]: import package
Any function that makes use of the optional dependency should be decorated with
@needs_package(“package”)
Keys of HAS_DEPENDENCY are import names. Distribution names from
pyproject.toml are normalized (PEP 503) and mapped through IMPORT_NAMES;
a distribution without an entry is looked up under its name with -
replaced by _. Looking up a name that is not a dependency of locan yields
False (with a warning logged once) instead of raising KeyError.
CONSTANTS
List of required dependencies (PyPi package names) |
|
List of optional dependencies (PyPi package names) |
|
A dictionary mapping normalized PyPi package names (PEP 503) to import names if they differ in more than |
|
A dictionary indicating if dependency (import name) is available. |
Classes
|
Python bindings to interact with Qt. |
Functions
|
Function that returns a decorator to check for optional dependency. |
|
Function that returns a decorator to check for package.version starting with major. |