pimlico.core.dependencies.python module¶
Tools for Python library dependencies.
Provides superclasses for Python library dependencies and a selection of commonly used dependency instances.
-
class
PythonPackageDependency
(package, name, **kwargs)[source]¶ Bases:
pimlico.core.dependencies.base.SoftwareDependency
Base class for Python dependencies. Provides import checks, but no installation routines. Subclasses should either provide install() or installation_instructions().
The import checks do not (as of 0.6rc) actually import the package, as this may have side-effects that are difficult to account for, causing odd things to happen when you check multiple times, or try to import later. Instead, it just checks whether the package finder is about to locate the package. This doesn’t guarantee that the import will succeed.
-
class
PythonPackageSystemwideInstall
(package_name, name, pip_package=None, apt_package=None, yum_package=None, **kwargs)[source]¶ Bases:
pimlico.core.dependencies.python.PythonPackageDependency
Dependency on a Python package that needs to be installed system-wide.
-
class
PythonPackageOnPip
(package, name=None, pip_package=None, **kwargs)[source]¶ Bases:
pimlico.core.dependencies.python.PythonPackageDependency
Python package that can be installed via pip. Will be installed in the virtualenv if not available.