Skip to main content

Command Palette

Search for a command to run...

How to publish a PYPI package on CONDA-FORGE

Updated
3 min read
How to publish a PYPI package on CONDA-FORGE
O
I build systems that work — technically sound, security-first, and actually useful to the people who depend on them. Creator of the UNICORN Binance Suite — 6 open source Python libraries with 2.8M+ PyPI downloads and 388+ dependent public projects. Currently pioneering AI-driven open source maintenance: running a controlled AI agent that maintains production code and documenting what it means for engineering teams. Vienna, Austria 🇦🇹

I am maintainer of some PyPi libraries and had the wish to publish them also on CONDA-FORGE.

I won’t go into why CONDA-FORGE and what’s great about Anaconda and the alternative package manager.

There are several ways, here is described the easiest and most modern way with grayskull .

Basically publishing a package only takes about 15 minutes if you know how!

First, some quick info:

Anyone can publish a PyPi package on CONDA-FORGE, you don’t have to be connected in any way to the project you want to publish.

You need a GitHub account and an installed Python.

The PyPi package must be available as a source package (SDIST) and not as a wheel on PyPi.

Here’s how:

1. The goal is to create a recipe. This is a file (meta.yaml) that contains all the information for CONDA-FORGE to automatically build a package. This recipe can be created automatically by the tool grayskull. So we start with the installation of grayskull either with pip or conda as described here: https://github.com/conda-incubator/grayskull#installation.

2. Once grayskull is installed, the command grayskull pypi <pypi-package-name> creates a recipe from the PyPi package, which can be submitted to CONDA-FORGE.
If this command throws the error AttributeError: Hash information for sdis was not found on PyPi metadata., then the PyPi package is not available as source distribution but probably only as wheel. A SDIST package can be created with the command python3 setup.py sdist and can be combined with the creation of a wheel: python3 setup.py bdist_wheel sdist

3. Once the recipe (meta.yaml) is created, please open and check it:

The maintainer name must match your github username.

In the about:sector change the url in home: to the project website and add below:
dev_url: https://github.com/you/repo
doc_url: https://you.github.io/repo

4. Create a fork of https://github.com/conda-forge/staged-recipes

5. Create a separate branch of the staged-recipes repository on Github for each recipe you want to submit.

6. Add a folder with the name of your package to the respective branch in the folder recipes and add the created meta.yamland start a pull request.
Read the comments for writing the pull request, check all the checkboxes and do what they ask for.

8. All CI checks of the PR should be successful. If so, create a new post with the content @conda-forge/staged-recipes, ready for review and @conda-forge-admin, please ping team. This triggers the editing process by the CONDA-FORGE team.

9. Wait for email messages and join the team on Github.

10. On each new PyPi release a bot opens a PR on the feedstock repository and you have to merge it manually to trigger the creation of a new package for conda. To make this automatically just add @conda-forge-admin, please add bot automerge.

Chat for support: https://gitter.im/conda-forge/conda-forge.github.io


I hope you found this informative and useful.

Follow me on Binance Square, GitHub, X, and LinkedIn, or join Telegram for updates on my latest publications. Constructive feedback is always appreciated.

Thank you for reading, and happy coding! ¯\_(ツ)_/¯

24 views
A

This is super useful for anyone maintaining Python packages across ecosystems. The conda-forge submission process can feel intimidating the first time — especially getting the recipe metadata right and dealing with the staged-recipes PR review. One thing I've found helpful is using grayskull to auto-generate the conda recipe from PyPI metadata. Did you run into any issues with dependency resolution between pip and conda environments during the process?

Build & Ship

Part 1 of 1

Practical posts about packaging, publishing, release engineering, developer workflows, and the tooling needed to get software out into the world cleanly and reliably.