conda-forge.github.io
conda-forge.github.io copied to clipboard
Add bot directive to remove a patch on a new release
Your question:
What happens from time-to-time is that a minor bug appears in an already released version (e.g. here). A nice option for the feedstock is to add a patch. However, this adds a maintenance burden as the patch has to be removed on the next release. It would be nice to have the bot do this.
For example:
{% set version = "10.1.1" %}
source:
url: https://github.com/fmtlib/fmt/archive/{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- patches/0001-fix-core-version-10.1.1.patch # [delete >{{ version }}]
Upon upgrading to 10.1.2 (or any version higher than 10.1.1) the bot could then remove the patch from meta.yaml
and remove the patch file.
You can always apply a selector using thr version directly to the line in the recipe with the patch. This won’t remove the line in the file but will remove the patch.
From the docs I could not find a selector that does it. Do you rather mean one could use jinja2
?
{% set version = "10.1.1" %}
source:
url: https://github.com/fmtlib/fmt/archive/{{ version }}.tar.gz
sha256: {{ sha256 }}
{% if {{ version }} == "10.1.1" %}
patches:
- patches/0001-fix-core-version-10.1.1.patch
{% endif %}
Indeed, that is not too bad. Still it would be nice to have a bot command to automatically clean-up.