Getting your library into conda-forge

Recently I went through the process, so let me document it for a quick reference.

I’m using lovely-numpy as an example, replace with <your package name>
CI - continuous integration
CF - conda forge
pypi - the thing behind pip
meta.yaml - the file that defines a conda package.

1 Get the package into pypi. Use nbdev_pypi to build and submit the package.

2.1 Fork and clone the staged-recipes https://github.com/conda-forge/staged-recipes repo
2.2 Install grayskull (from conda or pip)
2.3 cd into staged-recipes/recipes/, run

grayskull pypi --strict-conda-forge lovely-numpy

  • This will re-download the package from pypi and generate a meta.yaml in the staged-recipes/recipes/lovely-numpy/ directory.

2.4 Commit this file, push the commit to your forked repo, and send a pull request.

  • CF CI will lint and attempt to build your package for all platforms.

3.1 Run the checklist from the PR template
3.2 Ping the relevant @ (listed in the template) for review.

  • Once the reviewer is happy with your request, they will merge the PR.
  • CF CI will create a new feedstock repository, https://github.com/conda-forge/lovely-numpy-feedstock
  • It will contain your meta.yaml file, as well as files that control CI workflows.
  • You will be added to this repo and CF org. The CI will build and process the package.
  • At this point, the packages should be available in CF.

Note: The CI can be slow, the process might take hours to days.

How to update the package:

5.1 Push the new version to pypi.

5.2 Merge the PR if it looks good

  • This will trigger a new package generation by CI, and it will be available in CF.

You might want to generate meta.yaml yourself, because either the bot does not get it right, or you want to generate a new package build without changing the package version.
In this case:

6.1 Fork and clone the feedstock repo.
6,2 Change and commit the meta.yaml file. You probably want to use grayskull again for this.
6.3 Push the commit to the forked repo and send a PR to the CF repo.

  • CF CI will check your pull request.

6.5 Merge the PR if it looks good.

  • This will trigger a new package generation by CI, and it will be available in CF.

To make sure there is no confusion:
The CF repo is https://github.com/conda-forge/lovely-numpy-feedstock
The forked repo is https://github.com/xl0/lovely-numpy-feedstock
Clone the forked repo, push your changes to the forked repo, and then send a PR to merge it back into the CF repo.
This might seem convoluted but makes sure you run through CI before merging the new version.

Fin.
Congratulations on having your package in conda-forge!