pkglts.dependency module

Dependency object to handle multi dependency managers.

class pkglts.dependency.Dependency(name, version=None, pkg_mng=None, channel=None, intent='install')[source]

Bases: object

Simple container to keep track of all the required info to install a dependency.

channel

place to find the dependency depends on package_manager

conda_full_name()[source]

Produce fully qualified name with version number.

Returns:

(str)

conda_install()[source]

Produce command line needed to install this dependency.

Returns:

(str)

fmt_conda_requirement()[source]

Format dependency for conda requirements.yml files

Returns:

(str)

fmt_pip_requirement(extended=False)[source]

Format dependency for pip requirements.txt files

Returns:

(str)

intents

When does the package require this option: - ‘install’: only for installation (prod purpose) - ‘test’: for testing purpose only - ‘doc’: to compile the associated documentation - ‘example’: to replay the examples - ‘pkglts’: used internally to create dependencies between pkglts options

is_conda(strict=True)[source]

Check whether this dependency can be managed by conda

Parameters:

strict (bool) – whether only conda can manage this dep

Returns:

(bool)

is_pip(strict=True)[source]

Check whether this dependency can be managed by pip

Parameters:

strict (bool) – whether only pip can manage this dep

Returns:

(bool)

name

name of dependency

package_manager

either conda, pip or git url

pip_full_name()[source]

Produce fully qualified name with version number.

Returns:

(str)

pip_install()[source]

Produce command line needed to install this dependency.

Returns:

(str)

version

expected version