By Your Favourite Fake Biologist, Jason Shao (Last Edited: October 8th 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.
If you are interested in seeing a loose example, here is my work on eukfinder.
I wish you the best of luck in your quest!
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).
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).
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 for checksum. Both platforms offer intuitive workflow for generating a stable release, but the latter step 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.
Bioconda and their Apple fanboys insisted 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 appropriate binary executables and tags for MacOS. Follow this example source section of meta.yaml:
source:
- url: <executable compatible to both platforms>.tar.gz
sha256: <sha256 of url>
- url: <MacOS executable>.tar.gz # [osx]
sha256: <sha256 of url> # [osx]
- url: <Linux executable>.tar.gz # [linux]
sha256: <sha256 of url> # [linux]
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
Once assigned, the reviewer may go through several rounds of suggested revisions. Feel free to follow-up on suggested changes that you don't fully understand!