User Tools

Site Tools


making_bioconda_recipes

This is an old revision of the document!


By Your Favourite Fake Biologist, Jason Shao (Last Edited: September 13th 2024)

In my never-ending plight, I only found out about this great blog post on the same topic shared by Finlay Maguire right after my own gruelling research. Anyways, thanks Fin! :)

Since the linked guide does a better job at explaining the basics than I could ever do, I will therefore only share some useful hints and pitfalls to avoid.

I wish you the best of luck in your quest!

Source code is completed? Not so fast, write some CI checks!

You will notice that I speak a lot about CI checks in this page, that's because passing the checks is what making a recipe is all about! Writing your own CI checks is a great way to learn about what they are and how they work, so it doesn't feel like a black box when you try to pass bioconda CI checks.

P.S. Ideally, you should write CI checks early in development to concretely define expected behaviour, also known as Test-driven Development (I will soon release a guide about CI checks and link it here).

Source code is python only? Consider PyPi first!

As you know, conda and PyPi are both package managers, with the distinction that PyPi is only for python packages. The advantage of conda is that it has multi-language support, which is very relevant for bioinformatics tools. However, if your source code is python only, then you should consider releasing on PyPi first to avoid unnecessary overheads and CI checks. Conda also makes it very simple to release PyPi packages as conda recipes (much simpler than from scratch).

Source code is hosted on GitHub/GitLab? Generate a stable release (tar.gz)!

With git, the HEAD of the main branch is updated every time you push a commit to it. Bioconda hates this, and for good reasons too – it is very difficult to check for file integrity! Therefore, I strongly recommend generating a stable release instead, providing bioconda a tarball(tar.gz) of your source code and a hash with SHA256. Both platforms offer intuitive workflow for generating a stable release, but the latter is a bit more tricky. Follow these commands appropriate for your operating system:

Linux

$ sha256sum <Your Prefix>.tar.gz

MacOS

$ shasum -a 256 <Your Prefix>.tar.gz

However, the aforementioned two steps must be repeated for each time you make changes to your source code or your CI checks will fail, so it is very important to ensure your source code is truly ready beforehand.

My program is for Linux only? Think again!

Bioconda and their apple fanboys make it so that every bioconda recipe must be available for both Linux and MacOS, so don't be blindsided by this, fellow Linux enjoyer! Making your program more compatible entails adding binary executables and alternative build scripts for MacOS. uname is an universal environment variable to check for architecture, so you can put an if elif block in your build.sh like this:

if [[ $(uname) == "Darwin" ]]; then
    Your Code
elif [[ $(uname) == "Linux" ]]; then
    Your Code
else
    Your Code
if

And before you ask, yes it is really called Darwin, the Darwin we all know and love, thanks to Steve Jobs' sensationalism in the late 90s.

After an eternity, my checks are all passing...

Congratulations, champion of Considerable Grit, you are almost at the end! Make sure to make a comment to get your pull request ready to be reviewed!

@BiocondaBot please add label

Wow, it's really now merged!

Now you'll have to maintain it, nyeheheheheh!

making_bioconda_recipes.1726239033.txt.gz · Last modified: by 134.190.251.141