Summary
When converting V0 recipes to V1 format for noarch: python packages, the selector conversion produces match(python, ...) expressions in skip conditions. However, per CFEP-25 standards, V1 noarch Python recipes only define python_min in their variant configuration—not python. This causes rattler-build to skip all variants because the python variable is undefined.
Current Behavior
Converting a V0 recipe with a Python version selector like [py<310] for a noarch Python package produces:
build:
skip: match(python, "<3.10")
noarch: python
Expected Behavior
For noarch: python recipes, the conversion should produce:
build:
skip: match(python_min, "<3.10")
noarch: python
Root Cause
The _upgrade_selectors_to_conditionals() method in recipe_parser_convert.py (lines 335-351) converts Python version selectors using hardcoded python variable:
bool_expression = Regex.SELECTOR_PYTHON_VERSION_REPLACEMENT.sub(
r'match(python, "\1\2.\3")', bool_expression
)
The code does not check whether the recipe is a noarch: python package before deciding which variable to use.
Affected Patterns
| V0 Selector |
Current V1 Output |
Expected V1 Output (noarch) |
[py<310] |
match(python, "<3.10") |
match(python_min, "<3.10") |
[py310] |
match(python, "==3.10") |
match(python_min, "==3.10") |
[not py310] |
match(python, "!=3.10") |
match(python_min, "!=3.10") |
[py2k] |
match(python, ">=2,<3") |
match(python_min, ">=2,<3") |
[py3k] |
match(python, ">=3,<4") |
match(python_min, ">=3,<4") |
Suggested Fix
In _upgrade_selectors_to_conditionals():
- Check if the recipe has
noarch: python in the build section
- Use
python_min instead of python in match expressions when noarch: python is detected
Related Issues
Environment
- conda-recipe-manager version: latest (v0.9.3)
This issue was generated with the assistance of Claude Code
Summary
When converting V0 recipes to V1 format for
noarch: pythonpackages, the selector conversion producesmatch(python, ...)expressions in skip conditions. However, per CFEP-25 standards, V1 noarch Python recipes only definepython_minin their variant configuration—notpython. This causes rattler-build to skip all variants because thepythonvariable is undefined.Current Behavior
Converting a V0 recipe with a Python version selector like
[py<310]for a noarch Python package produces:Expected Behavior
For
noarch: pythonrecipes, the conversion should produce:Root Cause
The
_upgrade_selectors_to_conditionals()method inrecipe_parser_convert.py(lines 335-351) converts Python version selectors using hardcodedpythonvariable:The code does not check whether the recipe is a
noarch: pythonpackage before deciding which variable to use.Affected Patterns
[py<310]match(python, "<3.10")match(python_min, "<3.10")[py310]match(python, "==3.10")match(python_min, "==3.10")[not py310]match(python, "!=3.10")match(python_min, "!=3.10")[py2k]match(python, ">=2,<3")match(python_min, ">=2,<3")[py3k]match(python, ">=3,<4")match(python_min, ">=3,<4")Suggested Fix
In
_upgrade_selectors_to_conditionals():noarch: pythonin the build sectionpython_mininstead ofpythonin match expressions whennoarch: pythonis detectedRelated Issues
python_minvariable #307, V1 recipe should contain${{ python_min }}.*instead of${{ python_min }}#308Environment
This issue was generated with the assistance of Claude Code