whey-conda¶
Whey extension for creating Conda packages for Python projects.
Installation¶
python3 -m pip install whey-conda --user
First add the required channels
conda config --add channels https://conda.anaconda.org/conda-forge
conda config --add channels https://conda.anaconda.org/domdfcoding
Then install
conda install whey-conda
python3 -m pip install git+https://github.com/repo-helper/whey-conda@master --user
Contents¶
Configuration¶
whey-conda
is configured in the pyproject.toml
file defined in PEP 517 and PEP 518.
See also
The whey documentation
contains instructions for configuring whey
itself.
To enable whey-conda
, add the following lines to your pyproject.toml
file:
[tool.whey.builders]
binary = "whey_conda"
The whey-conda
-specific configuration is defined in the tool.whey-conda
table.
conda-channels
and conda-extras
can instead be defined in the tool.mkrecipe
table if you also use mkrecipe
.
[tool.whey-conda]
¶
All keys are optional.
- conda-description¶
Type: String
The description of the package.
You can use a single
%s
in the description, which will be substituted with the value of the description key frompyproject.toml
.The default value is
'%s'
.Example:
[tool.whey-conda] conda-description = "Fantastic Spam!"
- conda-channels¶
-
A list of required conda channels to build and use the package.
The default value is
[]
.Example:
[tool.whey-conda] conda-channels = [ "domdfcoding", "conda-forge", "bioconda",]
- conda-extras¶
Type: Array of strings or the strings
'all'
or'none'
.A list of extras (see optional-dependencies) to include as requirements in the Conda package.
The special keyword
'all'
indicates all extras should be included.The special keyword
'none'
indicates no extras should be included.
The default value is
'none'
.Examples:
[tool.whey-conda] conda-extras = [ "test", "doc",] [tool.whey-conda] conda-extras = "all"
Public API¶
Whey extension for creating Conda packages for Python projects.
Classes:
|
Builds Conda packages using metadata read from |
-
class
CondaBuilder
(project_dir, config, build_dir=None, out_dir=None, *, verbose=False, colour=None)[source]¶ Bases:
WheelBuilder
Builds Conda packages using metadata read from
pyproject.toml
.- Parameters
Methods:
build
()Build the Conda distribution.
Build the Conda distribution.
create_conda_archive
(wheel_contents_dir[, …])Create the conda archive.
Returns a list of the project’s runtime requirements.
Write the conda
about.json
file.write_conda_index
([build_number])Write the conda
index.json
file.write_license
(dest_dir[, dest_filename])Write the
LICENSE
file.Attributes:
Provides a default for the
build_dir
argument.The
info
directory in the build directory for Conda builds.-
build_conda
()[source]¶ Build the Conda distribution.
- Return type
- Returns
The filename of the created archive.
-
get_runtime_requirements
()[source]¶ Returns a list of the project’s runtime requirements.
- Return type
-
write_conda_index
(build_number=1)[source]¶ Write the conda
index.json
file.See also
https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#info-index-json
- Parameters
build_number (
int
) – Default1
.
whey_conda.config
¶
Configuration for whey-conda
.
Classes:
Parser for the |
-
class
WheyCondaParser
[source]¶ Bases:
AbstractConfigParser
Parser for the
[tool.whey-conda]
table frompyproject.toml
.Attributes:
The keys to parse from the TOML file.
Methods:
parse
(config[, set_defaults])Parse the TOML configuration.
parse_conda_channels
(config)Parse the
conda-channels
key, giving a list of required conda channels to build and use the package.parse_conda_description
(config)Parse the
conda-description
key, giving the description of the package.parse_conda_extras
(config)Parse the
conda-extras
key, giving a list of extras (see optional-dependencies) to include as requirements in the Conda package.-
parse_conda_channels
(config)[source]¶ Parse the
conda-channels
key, giving a list of required conda channels to build and use the package.The default value is
[]
.Example:
[tool.whey-conda] conda-channels = [ "domdfcoding", "conda-forge", "bioconda", ]
-
parse_conda_description
(config)[source]¶ Parse the
conda-description
key, giving the description of the package.You can use a single
%s
in the description, which will be substituted with the value of the description key frompyproject.toml
.The default value is
'%s'
.Example:
[tool.whey-conda] conda-description = "Fantastic Spam!"
-
parse_conda_extras
(config)[source]¶ Parse the
conda-extras
key, giving a list of extras (see optional-dependencies) to include as requirements in the Conda package.The special keyword
'all'
indicates all extras should be included.The special keyword
'none'
indicates no extras should be included.
The default value is
'none'
.Examples:
[tool.whey-conda] conda-extras = [ "test", "doc",] [tool.whey-conda] conda-extras = "all"
-
Downloading source code¶
The whey-conda
source code is available on GitHub,
and can be accessed from the following URL: https://github.com/repo-helper/whey-conda
If you have git
installed, you can clone the repository with the following command:
git clone https://github.com/repo-helper/whey-conda
Cloning into 'whey-conda'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 173 (delta 16), reused 17 (delta 6), pack-reused 126
Receiving objects: 100% (173/173), 126.56 KiB | 678.00 KiB/s, done.
Resolving deltas: 100% (66/66), done.

Downloading a ‘zip’ file of the source code¶
Building from source¶
The recommended way to build whey-conda
is to use tox:
tox -e build
The source and wheel distributions will be in the directory dist
.
If you wish, you may also use pep517.build or another PEP 517-compatible build tool.
License¶
whey-conda
is licensed under the MIT License
A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.
Permissions | Conditions | Limitations |
---|---|---|
|
|
Copyright (c) 2021 Dominic Davis-Foster
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
View the Function Index or browse the Source Code.