A place to submit conda recipes before they become fully fledged conda-forge feedstocks
See the codeThis repo is a holding area for recipes destined for a conda-forge feedstock repo.
Keep reading to learn about getting started, preparing your local environment, generating recipes for Python/R packages, linting, and building a package.
To find out more about conda-forge, see conda-smithy.
Fork this repository.
Make a new branch from main for your package's recipe.
Make a new folder in recipes for your package, and start a v1 recipe.yaml.
Recipe format policy: New recipes should use the v1 format. The v0
meta.yamlformat is deprecated for new recipes and should only be used in exceptional circumstances where v1 cannot support the recipe. Explain the exception in the pull request.
For more information:
(recommended) Try to build the feedstock locally.
Open a pull request, paying attention to the checklist. Building of your package will be tested on Linux, macOS, and Windows.
Ask for review or help by @-mentioning the appropriate review teams
(or using the bot command) in a pull request comment
When your pull request is reviewed and merged:
PRs are converted to feedstocks in two steps.
PRs get put into a merge queue for testing against
the latest CI scripts. Your PR may fail in the merge queue in which case it needs to be remerged. Be sure to update the
PR with the latest commits from main on the upstream repo before requesting the PR be merged again.
Recipes merged into the main branch are turned into feedstocks via the create feedstocks CI job on the
conda-forge/admin-requests repo.
Failures with the above job are often caused by API rate limits from the various services used by conda-forge. This can result in empty feedstock repositories and will resolve itself automatically. If the issue persists, support can be found on Zulip.
While all of the above steps eventually need to work in CI for a recipe to be merged, building locally is a good way to learn more about conda-forge, and make better use of donated, community resources.
build-locally.pyThe script build-locally.py will guide you through the local debugging process. This script
will then launch the platform-specific scripts, and the resulting artifacts will
be available under build_artifacts in the repository directory.
On Linux, everything runs in a Docker container. The staged-recipes directory is mounted as a volume.
On macOS and Windows, some environment variables control where files are kept:
MINIFORGE_HOME: Where the build tools will be installed. Defaults to ~/Miniforge3.CONDA_BLD_PATH: Where the build artifacts will be kept. Defaults to ~/Miniforge3/conda-bld
on macOS and C:\bld on Windows.build-locally.py can be run with any recent Python, or via a pixi task.
pixipixi...Linux
pixi run build-linux
macOS
pixi run build-osx
$CONDA_EXEWindows
pixi run build-win
$CONDA_EXEThese tasks will pass any extra arguments to build-locally.py, including --help. The resulting
artifacts will be available under build_artifacts.
$CONDA_EXEIf you have never used conda-forge before, you may need a conda-compatible
package manager, such as conda, mamba, or micromamba.
$CONDA_EXE, the "well-known" environment variable is used for
"a conda package manager in an activated POSIX shell session," is used
throughout this document.
On Windows, this environment variable would be
%CONDA_EXE%.
If a compatible $CONDA_EXE is not found, the build-locally.py script may download
micromamba: as a single file static binary it isn't installed, per se, and
can be used to create other environments.
miniforgeFor a more traditional installation, downloading, installing, and activating a
miniforge installer provides conda and mamba,
with conda-forge as the default source of packages. If found, build-locally.py
will use this instead of downloading micromamba.
pixipixi is a workspace-based environment and task runner optimized for conda packaging.
Several of the local workflows and their dependencies described below are captured
in pixi.toml. Install pixi via $CONDA_EXE:
$CONDA_EXE install -c conda-forge pixi
... or one of the documented approaches.
See the available tasks with pixi task list, or get started
building with pixi.
grayskullgrayskull can generate recipes from
Python packages on PyPI or R packages on CRAN.
The user should review the recipe generated, especially the license and dependencies.
Always pass --use-v1-format when invoking grayskull for a new recipe, as
shown below.
manually
install grayskull:
conda install -c conda-forge grayskull conda-recipe-manager
navigate to the recipes folder:
cd recipes
generate recipe:
Omit
--use-v1-formatonly in an exceptional case that requires the deprecated v0 format.
grayskull pypi --use-v1-format PACKAGE_ON_PYPI_HERE [ANOTHER...]
grayskull cran --use-v1-format PACKAGE_ON_CRAN_HERE [ANOTHER...]
with pixi:
pypi and cran tasks pass --use-v1-format):
The
pypi-v0andcran-v0tasks are deprecated and only for exceptional cases that require v0.
pixi run pypi PACKAGE_ON_PYPI_HERE [ANOTHER...]
pixi run cran PACKAGE_ON_CRAN_HERE [ANOTHER...]
conda-smithyThe conda-smithy package provides
helpful linters that can save CI resources by catching known issues up-front.
conda-smithy...Use one of:
manually
install conda-smithy:
conda install -c conda-forge conda-smithy shellcheck
lint recipes:
conda-smithy recipe-lint --conda-forge recipes/*
with pixi:
pixi run lintNOTES
conda-smithyis frequently updated with current best practices. Ensure using the latest with:
$CONDA_EXE upgrade conda-smithy shellcheck- or
pixi upgrade --feature conda-smithyto enable most
shellcheckrules
- create a
conda-forge.ymlnext to your new recipe (and any.shscripts):# recipes/your-new-recipe/conda-forge.yml shellcheck: enabled: true- run the linter using your preferred method, as described above
- if committed and pushed, this will be checked in CI during the review process, then merged into the defaults in the root of the rendered feedstock.
Look at one of these examples in this repository and modify it as necessary.
Follow the order of the sections in the example recipe. If you make a copy of example recipe, please remove the example's explainer comments from your recipe. Add your own comments to the recipe and build scripts to explain unusual build behavior or recipe options.
If there are details you are not sure about please open a pull request. The conda-forge team will be better able to answer questions about a failing build.
hash field?If your package is on PyPI, you can get the sha256 hash from your package's page on PyPI; look for the SHA256 link next to the download link for your package.
You can also generate a hash from the command line on Linux (and Mac if you install the necessary tools below). If you go this route, the sha256 hash is preferable to the md5 hash.
To generate the md5 hash: md5 your_sdist.tar.gz
To generate the sha256 hash: openssl sha256 your_sdist.tar.gz
You may need the openssl package, available on conda-forge:
conda install openssl -c conda-forge
Use the skip key in the build section along with a selector:
recipe.yaml
build:
skip: win
a full description of selectors is in the rattler-build docs
meta.yaml (only for exceptional cases)
build:
skip: true # [win]
A full description of selectors is in the conda docs.
If the package can otherwise be noarch you can also skip it by using virtual packages.
Note: As the package will always be built on linux, it needs to be at least available on there.
build: 0 entry mean?The build number is used when the source code for the package has not changed but you need to make a new build. For example, if one of the dependencies of the package was not properly specified the first time you build a package, then when you fix the dependency and rebuild the package you should increase the build number.
When the package version changes you should reset the build number to 0.
test field?No, you do not. The main purpose of the test section is to test whether this conda package was built and installed correctly (not whether the upstream package contains bugs).
Short answer: yes. Long answer: In principle, as long as your dependencies are in at least one of your user's conda channels they will be able to install your package. In practice, that is difficult to manage, and we strive to get all dependencies built in conda-forge.
{{ PYTHON }} -m pip install . -vv?This should be the default install line for most Python packages. This is preferable to python setup.py because it handles metadata in a conda-friendlier way.
bld.bat and/or build.sh?In many cases, no. Python packages almost never need it. If the build can be done with one line you can put it in the script line of the build section.
If you would like help with .sh best practices, see more information about
linting with conda-smithy and shellcheck.
The maintainers "job" is to:
recipes directory? Should I do something about it?When a PR of recipe(s) is ready to go, it is merged into main. This will trigger a CI build specially designed to convert the recipe(s). However, for any number of reasons the recipe(s) may not be converted right away. In the interim, the recipe(s) will remain in main until they can be converted. There is no action required on the part of recipe contributors to resolve this. Also it should have no impact on any other PRs being proposed. If these recipe(s) pending conversion do cause issues for your submission, please ping conda-forge/core for help.
Sometimes, some of the CI tools' builds fail due to no error within your recipe. If that happens, you can trigger a rebuild by re-creating the last commit and force pushing it to your branch:
# edit your last commit, giving it a new time stamp and hash
# (you can just leave the message as it is)
git commit --amend
# push to github, overwriting your branch
git push -f
If the problem was due to scripts in the staged-recipes repository, you may be asked to "rebase" once these are fixed. To do so, run:
# If you didn't add a remote for conda-forge/staged-recipes yet, also run
# these lines:
# git remote add upstream https://github.com/conda-forge/staged-recipes.git
# git fetch --all
git rebase upstream/main
git push -f
Thank you very much for putting in this recipe PR!
This repository is very active, so if you need help with a PR, please let the right people know.
There are language-specific teams for reviewing recipes.
| Language | Name of review team |
|---|---|
| c/c++ | @conda-forge/help-c-cpp |
| go | @conda-forge/help-go |
| java | @conda-forge/help-java |
| Julia | @conda-forge/help-julia |
| nodejs | @conda-forge/help-nodejs |
| perl | @conda-forge/help-perl |
| python | @conda-forge/help-python |
| python/c hybrid | @conda-forge/help-python-c |
| r | @conda-forge/help-r |
| ruby | @conda-forge/help-ruby |
| rust | @conda-forge/help-rust |
| other | @conda-forge/staged-recipes |
Once the PR is ready for review, please mention one of the teams above in a
new comment. i.e. @conda-forge/help-some-language, ready for review!
Then, a bot will label the PR as 'review-requested'.
Due to GitHub limitations, first time contributors to conda-forge are unable
to ping conda-forge teams directly, but you can ask a bot to ping the team
using a special command in a comment on the PR to get the attention of the
staged-recipes team. You can also consider asking on our Zulip chat
if your recipe isn't reviewed promptly.
All apologies in advance if your recipe PR does not receive prompt attention. This is a high volume repository and the reviewers are volunteers. Review times vary depending on the number of reviewers on a given language team and may be days or weeks. We are always looking for more staged-recipe reviewers. If you are interested in volunteering, please contact a member of @conda-forge/core. We'd love to have your help!
There's no changelog file, but the following git command gives a good overview of the recent changes in the repository:
$ git log --merges -- ':!recipes'
(top 24 of 30)
32,386 followers · starred Apr 2019
386 followers · starred Jul 2016
1,505 followers · starred Aug 2022
270 followers · starred Sep 2017
A place to submit conda recipes before they become fully fledged conda-forge feedstocks
See the codeThis repo is a holding area for recipes destined for a conda-forge feedstock repo.
Keep reading to learn about getting started, preparing your local environment, generating recipes for Python/R packages, linting, and building a package.
To find out more about conda-forge, see conda-smithy.
Fork this repository.
Make a new branch from main for your package's recipe.
Make a new folder in recipes for your package, and start a v1 recipe.yaml.
Recipe format policy: New recipes should use the v1 format. The v0
meta.yamlformat is deprecated for new recipes and should only be used in exceptional circumstances where v1 cannot support the recipe. Explain the exception in the pull request.
For more information:
(recommended) Try to build the feedstock locally.
Open a pull request, paying attention to the checklist. Building of your package will be tested on Linux, macOS, and Windows.
Ask for review or help by @-mentioning the appropriate review teams
(or using the bot command) in a pull request comment
When your pull request is reviewed and merged:
PRs are converted to feedstocks in two steps.
PRs get put into a merge queue for testing against
the latest CI scripts. Your PR may fail in the merge queue in which case it needs to be remerged. Be sure to update the
PR with the latest commits from main on the upstream repo before requesting the PR be merged again.
Recipes merged into the main branch are turned into feedstocks via the create feedstocks CI job on the
conda-forge/admin-requests repo.
Failures with the above job are often caused by API rate limits from the various services used by conda-forge. This can result in empty feedstock repositories and will resolve itself automatically. If the issue persists, support can be found on Zulip.
While all of the above steps eventually need to work in CI for a recipe to be merged, building locally is a good way to learn more about conda-forge, and make better use of donated, community resources.
build-locally.pyThe script build-locally.py will guide you through the local debugging process. This script
will then launch the platform-specific scripts, and the resulting artifacts will
be available under build_artifacts in the repository directory.
On Linux, everything runs in a Docker container. The staged-recipes directory is mounted as a volume.
On macOS and Windows, some environment variables control where files are kept:
MINIFORGE_HOME: Where the build tools will be installed. Defaults to ~/Miniforge3.CONDA_BLD_PATH: Where the build artifacts will be kept. Defaults to ~/Miniforge3/conda-bld
on macOS and C:\bld on Windows.build-locally.py can be run with any recent Python, or via a pixi task.
pixipixi...Linux
pixi run build-linux
macOS
pixi run build-osx
$CONDA_EXEWindows
pixi run build-win
$CONDA_EXEThese tasks will pass any extra arguments to build-locally.py, including --help. The resulting
artifacts will be available under build_artifacts.
$CONDA_EXEIf you have never used conda-forge before, you may need a conda-compatible
package manager, such as conda, mamba, or micromamba.
$CONDA_EXE, the "well-known" environment variable is used for
"a conda package manager in an activated POSIX shell session," is used
throughout this document.
On Windows, this environment variable would be
%CONDA_EXE%.
If a compatible $CONDA_EXE is not found, the build-locally.py script may download
micromamba: as a single file static binary it isn't installed, per se, and
can be used to create other environments.
miniforgeFor a more traditional installation, downloading, installing, and activating a
miniforge installer provides conda and mamba,
with conda-forge as the default source of packages. If found, build-locally.py
will use this instead of downloading micromamba.
pixipixi is a workspace-based environment and task runner optimized for conda packaging.
Several of the local workflows and their dependencies described below are captured
in pixi.toml. Install pixi via $CONDA_EXE:
$CONDA_EXE install -c conda-forge pixi
... or one of the documented approaches.
See the available tasks with pixi task list, or get started
building with pixi.
grayskullgrayskull can generate recipes from
Python packages on PyPI or R packages on CRAN.
The user should review the recipe generated, especially the license and dependencies.
Always pass --use-v1-format when invoking grayskull for a new recipe, as
shown below.
manually
install grayskull:
conda install -c conda-forge grayskull conda-recipe-manager
navigate to the recipes folder:
cd recipes
generate recipe:
Omit
--use-v1-formatonly in an exceptional case that requires the deprecated v0 format.
grayskull pypi --use-v1-format PACKAGE_ON_PYPI_HERE [ANOTHER...]
grayskull cran --use-v1-format PACKAGE_ON_CRAN_HERE [ANOTHER...]
with pixi:
pypi and cran tasks pass --use-v1-format):
The
pypi-v0andcran-v0tasks are deprecated and only for exceptional cases that require v0.
pixi run pypi PACKAGE_ON_PYPI_HERE [ANOTHER...]
pixi run cran PACKAGE_ON_CRAN_HERE [ANOTHER...]
conda-smithyThe conda-smithy package provides
helpful linters that can save CI resources by catching known issues up-front.
conda-smithy...Use one of:
manually
install conda-smithy:
conda install -c conda-forge conda-smithy shellcheck
lint recipes:
conda-smithy recipe-lint --conda-forge recipes/*
with pixi:
pixi run lintNOTES
conda-smithyis frequently updated with current best practices. Ensure using the latest with:
$CONDA_EXE upgrade conda-smithy shellcheck- or
pixi upgrade --feature conda-smithyto enable most
shellcheckrules
- create a
conda-forge.ymlnext to your new recipe (and any.shscripts):# recipes/your-new-recipe/conda-forge.yml shellcheck: enabled: true- run the linter using your preferred method, as described above
- if committed and pushed, this will be checked in CI during the review process, then merged into the defaults in the root of the rendered feedstock.
Look at one of these examples in this repository and modify it as necessary.
Follow the order of the sections in the example recipe. If you make a copy of example recipe, please remove the example's explainer comments from your recipe. Add your own comments to the recipe and build scripts to explain unusual build behavior or recipe options.
If there are details you are not sure about please open a pull request. The conda-forge team will be better able to answer questions about a failing build.
hash field?If your package is on PyPI, you can get the sha256 hash from your package's page on PyPI; look for the SHA256 link next to the download link for your package.
You can also generate a hash from the command line on Linux (and Mac if you install the necessary tools below). If you go this route, the sha256 hash is preferable to the md5 hash.
To generate the md5 hash: md5 your_sdist.tar.gz
To generate the sha256 hash: openssl sha256 your_sdist.tar.gz
You may need the openssl package, available on conda-forge:
conda install openssl -c conda-forge
Use the skip key in the build section along with a selector:
recipe.yaml
build:
skip: win
a full description of selectors is in the rattler-build docs
meta.yaml (only for exceptional cases)
build:
skip: true # [win]
A full description of selectors is in the conda docs.
If the package can otherwise be noarch you can also skip it by using virtual packages.
Note: As the package will always be built on linux, it needs to be at least available on there.
build: 0 entry mean?The build number is used when the source code for the package has not changed but you need to make a new build. For example, if one of the dependencies of the package was not properly specified the first time you build a package, then when you fix the dependency and rebuild the package you should increase the build number.
When the package version changes you should reset the build number to 0.
test field?No, you do not. The main purpose of the test section is to test whether this conda package was built and installed correctly (not whether the upstream package contains bugs).
Short answer: yes. Long answer: In principle, as long as your dependencies are in at least one of your user's conda channels they will be able to install your package. In practice, that is difficult to manage, and we strive to get all dependencies built in conda-forge.
{{ PYTHON }} -m pip install . -vv?This should be the default install line for most Python packages. This is preferable to python setup.py because it handles metadata in a conda-friendlier way.
bld.bat and/or build.sh?In many cases, no. Python packages almost never need it. If the build can be done with one line you can put it in the script line of the build section.
If you would like help with .sh best practices, see more information about
linting with conda-smithy and shellcheck.
The maintainers "job" is to:
recipes directory? Should I do something about it?When a PR of recipe(s) is ready to go, it is merged into main. This will trigger a CI build specially designed to convert the recipe(s). However, for any number of reasons the recipe(s) may not be converted right away. In the interim, the recipe(s) will remain in main until they can be converted. There is no action required on the part of recipe contributors to resolve this. Also it should have no impact on any other PRs being proposed. If these recipe(s) pending conversion do cause issues for your submission, please ping conda-forge/core for help.
Sometimes, some of the CI tools' builds fail due to no error within your recipe. If that happens, you can trigger a rebuild by re-creating the last commit and force pushing it to your branch:
# edit your last commit, giving it a new time stamp and hash
# (you can just leave the message as it is)
git commit --amend
# push to github, overwriting your branch
git push -f
If the problem was due to scripts in the staged-recipes repository, you may be asked to "rebase" once these are fixed. To do so, run:
# If you didn't add a remote for conda-forge/staged-recipes yet, also run
# these lines:
# git remote add upstream https://github.com/conda-forge/staged-recipes.git
# git fetch --all
git rebase upstream/main
git push -f
Thank you very much for putting in this recipe PR!
This repository is very active, so if you need help with a PR, please let the right people know.
There are language-specific teams for reviewing recipes.
| Language | Name of review team |
|---|---|
| c/c++ | @conda-forge/help-c-cpp |
| go | @conda-forge/help-go |
| java | @conda-forge/help-java |
| Julia | @conda-forge/help-julia |
| nodejs | @conda-forge/help-nodejs |
| perl | @conda-forge/help-perl |
| python | @conda-forge/help-python |
| python/c hybrid | @conda-forge/help-python-c |
| r | @conda-forge/help-r |
| ruby | @conda-forge/help-ruby |
| rust | @conda-forge/help-rust |
| other | @conda-forge/staged-recipes |
Once the PR is ready for review, please mention one of the teams above in a
new comment. i.e. @conda-forge/help-some-language, ready for review!
Then, a bot will label the PR as 'review-requested'.
Due to GitHub limitations, first time contributors to conda-forge are unable
to ping conda-forge teams directly, but you can ask a bot to ping the team
using a special command in a comment on the PR to get the attention of the
staged-recipes team. You can also consider asking on our Zulip chat
if your recipe isn't reviewed promptly.
All apologies in advance if your recipe PR does not receive prompt attention. This is a high volume repository and the reviewers are volunteers. Review times vary depending on the number of reviewers on a given language team and may be days or weeks. We are always looking for more staged-recipe reviewers. If you are interested in volunteering, please contact a member of @conda-forge/core. We'd love to have your help!
There's no changelog file, but the following git command gives a good overview of the recent changes in the repository:
$ git log --merges -- ':!recipes'
(top 24 of 30)
32,386 followers · starred Apr 2019
386 followers · starred Jul 2016
1,505 followers · starred Aug 2022
270 followers · starred Sep 2017