Skip to content

fix: use python_min in skip conditions for noarch Python recipes - #480

Open
janjagusch wants to merge 1 commit into
conda:mainfrom
janjagusch:fix/python-min-skip-condition-noarch
Open

fix: use python_min in skip conditions for noarch Python recipes#480
janjagusch wants to merge 1 commit into
conda:mainfrom
janjagusch:fix/python-min-skip-condition-noarch

Conversation

@janjagusch

Copy link
Copy Markdown

Summary

Per CFEP-25 standards, V1 noarch Python recipes only define python_min in their variant configuration, not python. This PR fixes the V0→V1 recipe conversion to use python_min instead of python in skip condition match expressions for noarch Python packages.

Changes

  • Added _is_noarch_python() helper method to detect noarch: python recipes
  • Modified _upgrade_selectors_to_conditionals() to use python_min for noarch Python recipes
  • Added test case with noarch-python-skip.yaml fixture

Before

build:
  skip: match(python, "<3.10")
  noarch: python

After

build:
  skip: match(python_min, "<3.10")
  noarch: python

Related Issues

Test Plan

  • Added unit test noarch-python-skip.yaml that verifies the fix
  • Verified existing selector-match-upgrades.yaml test still passes (non-noarch recipes still use python)
  • All 34 tests in test_recipe_parser_convert.py pass

This PR was generated with the assistance of Claude Code

Per CFEP-25 standards, V1 noarch Python recipes only define `python_min`
in their variant configuration, not `python`. When converting V0 recipes
to V1 format, Python version selectors like `[py<310]` should now produce
`match(python_min, "<3.10")` instead of `match(python, "<3.10")` for
noarch Python packages.

This prevents rattler-build from skipping all variants due to an undefined
`python` variable.

Fixes conda#479

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@schuylermartin45

schuylermartin45 commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

Apologies for the slow response on this, I have been absolutely swamped by other work lately.

At first glance I think this is a great change and I really appreciate the contribution! However I think this may be specific to how conda-forge operates and not necessarily how everyone in the wider Conda Community operates. We try to keep Conda Recipe Manager and its tooling accessible for all Conda users.

The way we've handled this in the past is to offer additional flags to crm convert (or whatever crm * CLI command(s) apply to the situation). That way, all members of the Conda Community can use the tooling as they see fit.

Once a flag is added to crm convert, you can take advantage of the RecipeReaderFlags class/enum to trickle that option down to the RecipeParserConvert class.

Let me know if that sounds like a good plan. Thanks!

@janjagusch

Copy link
Copy Markdown
Author

Apologies for the slow response on this, I have been absolutely swamped by other work lately.

At first glance I think this is a great change and I really appreciate the contribution! However I think this may be specific to how conda-forge operates and not necessarily how everyone in the wider Conda Community operates. We try to keep Conda Recipe Manager and its tooling accessible for all Conda users.

The way we've handled this in the past is to offer additional flags to crm convert (or whatever crm * CLI command(s) apply to the situation). That way, all members of the Conda Community can use the tooling as they see fit.

Once a flag is added to crm convert, you can take advantage of the RecipeReaderFlags class/enum to trickle that option down to the RecipeParserConvert class.

Let me know if that sounds like a good plan. Thanks!

Thanks for the pointer, @schuylermartin45. I must admit I wasn't aware that CRM provides tooling for the whole Conda community, and not just Conda-Forge. I'll try to look into your suggestion this week. :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V1 conversion should use python_min instead of python in skip conditions for noarch Python recipes

3 participants