shippinglabel_conda

Shippinglabel extension with utilities conda packages.

This extension must be installed separately:

python3 -m pip install shippinglabel-conda --user

__version__ = '0.1.0.post1'

The version number of this extension.

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.

clear_cache(*channel_name)[source]

Clear the cached Conda channel listings.

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.

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().

Parameters

channel_name (str)

Raises

ValueError – if the channel can’t be found.

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.

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.

Parameters
Return type

List[ComparableRequirement]