shippinglabel_conda
Shippinglabel extension with utilities conda packages.
This extension must be installed separately:
python3 -m pip install shippinglabel-conda --user
First add the required channels
conda config --add channels https://conda.anaconda.org/domdfcoding
conda config --add channels https://conda.anaconda.org/conda-forge
Then install
conda install shippinglabel-conda
-
__version__
= '0.1.0.post1' The version number of this extension.
Data:
Instance of |
Functions:
|
Clear the cached Conda channel listings. |
|
Compile a list of requirements for the package from the |
|
Obtain the list of packages in the given Conda channel, either from the cache or from the Conda API. |
|
Create a description for the Conda package from its summary and a list of channels required to install it. |
|
Prepare a list of requirements for use with conda. |
|
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
- Return type
-
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
-
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.
-
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
-
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
requirements (
Iterable
[ComparableRequirement
])
- Return type