|
| 1 | +--- |
| 2 | +tags: [how-to, basic] |
| 3 | +--- |
| 4 | + |
| 5 | +# How to rerender a feedstock |
| 6 | + |
| 7 | +Rerendering is the process of regenerating the templated contents of your feedstock, according to the contents of `conda-forge.yml` and the recipe itself. |
| 8 | + |
| 9 | +<!-- PENDING: Read more about it in [Rerendering a feedstock](#TODO). --> |
| 10 | + |
| 11 | +:::tip When to rerender |
| 12 | + |
| 13 | +We need to re-render when there are changes in the following parts of the feedstock: |
| 14 | + |
| 15 | +- Platform configuration (`skip` sections). |
| 16 | +- `yum_requirements.txt` or `conda-forge.yml`. |
| 17 | +- Updates in the build matrix due to new versions of Python, NumPy, PERL, R, etc. |
| 18 | +- Updates in conda-forge pinning that affect the feedstock. |
| 19 | +- Build issues that a feedstock configuration update will fix (follow us on [Zulip](https://conda-forge.zulipchat.com/) to know about those). |
| 20 | + |
| 21 | +::: |
| 22 | + |
| 23 | +There are two ways of rerendering a feedstock: |
| 24 | + |
| 25 | +- Via bot commands on the feedstock issue tracker |
| 26 | +- Using `conda-smithy` locally |
| 27 | + |
| 28 | +## With bot commands |
| 29 | + |
| 30 | +Simply open a new issue in the feedstock titled `@conda-forge-admin, please rerender`. The description can be left empty. A new PR will be opened after a few seconds, and will receive a new commit with the rerendered changes within minutes. |
| 31 | + |
| 32 | +## With `conda-smithy` |
| 33 | + |
| 34 | +Behind the bot command, our automation ran `conda-smithy rerender` on your feedstock and published the changes. You can also do this locally. |
| 35 | + |
| 36 | +### 1. Prepare the forked feedstock |
| 37 | + |
| 38 | +If you haven't already, fork the feedstock to your personal account. Then clone the fork to disk and [create a fresh branch out of your synced `main`](fork-sync.md): |
| 39 | + |
| 40 | +``` |
| 41 | +cd name-feedstock |
| 42 | +git checkout main |
| 43 | +git pull upstream main |
| 44 | +git checkout -b rerender |
| 45 | +``` |
| 46 | + |
| 47 | +Depending on your `conda-forge.yml` configuration, from now on you will need to run different steps: |
| 48 | + |
| 49 | +- Option A: With `conda_install_tool: pixi`, you only need to install Pixi and run `pixi run rerender`. |
| 50 | +- Option B: With other `conda_install_tool` settings you need to install `conda-smithy` on your own. |
| 51 | + |
| 52 | +### 2a. Rerender with `conda_install_tool: pixi` |
| 53 | + |
| 54 | +1. Download and install `pixi` (check [their documentation](https://pixi.sh/latest/installation/)). |
| 55 | +2. Go to the cloned repository and run `pixi run rerender`. |
| 56 | + |
| 57 | +### 2b. Rerender with other `conda_install_tool` settings |
| 58 | + |
| 59 | +Create a new environment with `conda-smithy`: |
| 60 | + |
| 61 | +```bash |
| 62 | +conda create -n conda-smithy -c conda-forge conda-smithy shellcheck |
| 63 | +``` |
| 64 | + |
| 65 | +Activate it and run `conda-smithy` from the cloned repository directory: |
| 66 | + |
| 67 | +```bash |
| 68 | +conda activate conda-smithy |
| 69 | +cd name-feedstock |
| 70 | +conda-smithy rerender |
| 71 | +``` |
| 72 | + |
| 73 | +### 3. Commit and push the results to a new pull request |
| 74 | + |
| 75 | +Once the rerender is done, `conda-smithy` will have added the rerender changes to the staging area of your repository and prepared a commit message for you. Use it to commit the changes and push the branch to your fork: |
| 76 | + |
| 77 | +``` |
| 78 | +git commit -m "<copied message>" |
| 79 | +git push -u origin rerender |
| 80 | +``` |
| 81 | + |
| 82 | +The git remote will suggest you to open a PR with the new changes. Follow that link and fill in the PR template. |
| 83 | + |
| 84 | +### Troubleshooting |
| 85 | + |
| 86 | +#### New conda-smithy version available |
| 87 | + |
| 88 | +Please update your local conda-smithy version: |
| 89 | + |
| 90 | +- `conda update -n conda-smithy conda-smithy` |
| 91 | +- `pixi run --force-reinstall rerender` |
| 92 | + |
| 93 | +If you are intentionally using an older version, then pass `--no-check-uptodate` to `conda-smithy: |
| 94 | + |
| 95 | +``` |
| 96 | +conda-smithy rerender --no-check-uptodate |
| 97 | +``` |
0 commit comments