Skip to content

Commit 3f9aec4

Browse files
add blog/2021-06-16-graykull-step-by-step.md
Co-authored-by: ForgottenProgramme <[email protected]>
1 parent 511dcd0 commit 3f9aec4

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
authors:
3+
- name: Mahe
4+
title: Outreachy intern
5+
url: https://github.com/ForgottenProgramme
6+
image_url: https://github.com/ForgottenProgramme.png
7+
tags: [grayskull, outreachy]
8+
---
9+
10+
# Contributing Packages To conda-forge Using Grayskull
11+
12+
When contributing packages to conda-forge, Grayskull can make your life
13+
much easier. Grayskull generates recipes for Python packages hosted on
14+
PyPI.
15+
16+
<!--truncate-->
17+
18+
As the
19+
[introduction](https://github.com/conda-incubator/grayskull#introduction)
20+
for Grayskull reads; "The main goal of this project is to generate
21+
concise recipes for conda-forge." In this tutorial we learn how to
22+
contribute a Python package to the conda-forge channel using Grayskull
23+
to generate the recipe.
24+
25+
Let us get started.
26+
27+
1. Install `grayskull` using `conda` through the `conda-forge` channel:
28+
29+
```
30+
$ conda install -c conda-forge grayskull
31+
```
32+
33+
2. Fork and clone the conda-forge [staged-recipes
34+
repository](https://github.com/conda-forge/staged-recipes) from
35+
GitHub.
36+
37+
3. Checkout a new branch from the `master branch`.
38+
39+
4. Through CLI, cd inside the 'staged-recipes/recipes' directory.
40+
41+
5. Call `grayskull` and pass the `pypi` repository, followed by the
42+
name of the package you want to contribute to conda-forge. For
43+
example: `grayskull pypi abc`
44+
45+
Or you could use `grayskull pypi abc --strict-conda-forge` to remove
46+
some selectors which are not necessary for conda-forge and adapt
47+
recipes to fit better in the conda-forge ecosystem.
48+
49+
Grayskull will create a folder with the same name as the package (in
50+
this case: 'abc') in the 'recipes' folder of the 'staged-recipes'
51+
directory. This folder will contain the `meta.yaml` file and also
52+
the license file if the package includes a license in the PyPI
53+
distribution.
54+
55+
6. Go through the generated `meta.yaml` file. For simpler packages, the
56+
generated recipes are nearly perfect, but for some packages you
57+
might need to make certain tweaks.
58+
59+
7. Commit and push the changes. `git add recipe/abc/meta.yaml`
60+
`git commit -m "add a commit message"` `git push`
61+
62+
8. Create a PR.
63+
64+
9. Once the CI is passing, post a comment saying:
65+
`This is ready for review` `@conda-forge-admin, please ping team`
66+
67+
Once the PR gets merged, your package will be available on the
68+
conda-forge channel. Tada! It's that easy.

0 commit comments

Comments
 (0)