Skip to content

Accept callable as patch_generator (#235) - #314

Open
dholth wants to merge 2 commits into
mainfrom
235-repodata-patch-callable
Open

Accept callable as patch_generator (#235)#314
dholth wants to merge 2 commits into
mainfrom
235-repodata-patch-callable

Conversation

@dholth

@dholth dholth commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The patch system now accepts a function (callable) in addition to a file path or conda package path. The callable should accept (repodata, subdir) arguments and return patch instructions.

Description

Fix #235

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

The patch system now accepts a function (callable) in addition to a
file path or conda package path. The callable should accept (repodata, subdir)
arguments and return patch instructions.
@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Jun 22, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jun 22, 2026

@danyeaw danyeaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @dholth! Since #235 called out easier testing as the motivation, could what do you think about adding a small test that passes a callable directly?


instructions = {}

if patch_generator and patch_generator.endswith(CONDA_PACKAGE_EXTENSIONS):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need an if not callable guard here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

Improve repodata patch system

3 participants