Contributing Packages To conda-forge Using Grayskull
When contributing packages to conda-forge, Grayskull can make your life much easier. Grayskull generates recipes for Python packages hosted on PyPI. As the introduction for Grayskull reads; “The main goal of this project is to generate concise recipes for conda-forge.”
In this tutorial we learn how to contribute a Python package to the conda-forge channel using Grayskull to generate the recipe.
Let us get started.
- Install
grayskull
usingconda
through theconda-forge
channel:conda install -c conda-forge grayskull
- Fork and clone the conda-forge staged-recipes repository from GitHub.
- Fetch a new branch from the
master
branch. - Through CLI enter inside the ‘staged-recipes’ directory.
- Call
grayskull
and pass thepypi
repository, followed by the name of the package you want to contribute to conda-forge. For example:grayskull pypi abc
Grayskull will create a folder with the same name as the package (in this case: ‘abc’) in the ‘recipes’ folder of the ‘staged-recipes’ directory.
This folder will contain themeta.yaml
file and also the license file if the package includes a license in the PyPI distribution. - Go through the generated
meta.yaml
file. For simpler packages, the generated recipes are nearly perfect, but for some packages you might need to make certain tweaks. - Commit and push the changes.
git add.
git commit -m “add a commit message”
git push
- Create a PR. Dropping a message in the conda-forge public Gitter channel and a link to your PR might be a good idea to get your PR reviewed and merged.
Once the PR gets merged, your package will be available on the conda-forge channel.
Tada! It’s that easy.