#3355·metaflow

@conda/@pypi cannot specify fuzzy python version

Author: jim22kCreated Aug 28, 2026Updated Sep 28, 2026

Issue

@conda(python="3.11") will only match Python 3.11.0. It becomes an exact match when passed to micromamba solver. See the match spec docs for how == is treated vs =.

The same thing happens for @pypi(python="3.11"). They both use the same micromamba resolution for the environment Python version.

Attempting to provide a fancy match string fails (e.g. @conda(python=">=3.11,<3.12")) because it is rewritten as python==>=3.11,<3.12, which is invalid syntax.

Solution 1

The minimal fix would involve wrapping the python version in _double_equal_match logic so fancy match strings would work. See line 133 of micromamba.py for how that works for all other dependencies besides the base Python.

Solution 2

A more aggressive fix would involve _double_equal_match PLUS default to fuzzy matching (e.g. python=3.11). I feel that would be less surprising to most users who write @conda(python="3.11") expecting to get the latest patch version, not the .0 version. However, this would affect existing workflows.

I'm happy to create a PR once there is agreement on the correct solution (1) or (2).