shippinglabel.conda

Attention

This module is deprecated and will be removed in v2.0.0. Please use the new shippinglabel_conda extension instead.

Functions to aid building of conda packages.

New in version 0.7.0.

Data:

CONDA_API

Instance of apeye.slumber_url.SlumberURL for accessing the Conda API.

Functions:

clear_cache(*channel_name)

Clear the cached Conda channel listings.

compile_requirements(repo_dir[, extras])

Compile a list of requirements for the package from the requirements.txt file, and any extra dependencies.

get_channel_listing(channel_name)

Obtain the list of packages in the given Conda channel, either from the cache or from the Conda API.

make_conda_description(summary[, conda_channels])

Create a description for the Conda package from its summary and a list of channels required to install it.

prepare_requirements(requirements)

Prepare a list of requirements for use with conda.

validate_requirements(requirements, …)

Ensure that all requirements are available from the given Conda channels, and normalize the names to those in the Conda channel.

CONDA_API = SlumberURL('https://conda.anaconda.org')

Type:    SlumberURL

Instance of apeye.slumber_url.SlumberURL for accessing the Conda API.

New in version 0.7.0.

clear_cache(*channel_name)[source]

Clear the cached Conda channel listings.

New in version 0.7.0.

Parameters

*channel_name (str) – The name(s) of the channels to clear the cache for.

If no arguments are given the cache is cleared for all channels.

compile_requirements(repo_dir, extras=())[source]

Compile a list of requirements for the package from the requirements.txt file, and any extra dependencies.

New in version 0.7.0.

Parameters
  • repo_dir (PathPlus)

  • extras (Iterable[str]) – A list of additional, optional requirements. These would be specified in “extras_require” for setuptools. Default ().

Return type

List[ComparableRequirement]

get_channel_listing(channel_name)[source]

Obtain the list of packages in the given Conda channel, either from the cache or from the Conda API.

Responses are cached for 48 hours. The cache can be cleared manually with clear_cache().

New in version 0.7.0.

Parameters

channel_name (str)

Raises

ValueError – if the channel can’t be found (New in version 0.15.0).

Return type

List[str]

make_conda_description(summary, conda_channels=())[source]

Create a description for the Conda package from its summary and a list of channels required to install it.

The description will look like:

This is my fancy Conda package. Hope you like it 😉.


Before installing please ensure you have added the following channels: conda-forge, bioconda

if called as follows:

make_conda_description(
    "This is my fancy Conda package. Hope you like it 😉.",
    ["conda-forge", "bioconda"],
)

New in version 0.8.0.

Parameters
Return type

str

prepare_requirements(requirements)[source]

Prepare a list of requirements for use with conda.

This entails removing any extras and markers from the requirements, and skipping any requirements with URLs, as conda does not support these.

New in version 0.13.0.

Parameters

requirements (Iterable[ComparableRequirement])

Return type

Iterable[ComparableRequirement]

validate_requirements(requirements, conda_channels)[source]

Ensure that all requirements are available from the given Conda channels, and normalize the names to those in the Conda channel.

New in version 0.7.0.

Parameters
Return type

List[ComparableRequirement]