You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Retry with inferred Python constraint on uv pip install failure #1618
prek resolves the Python version for hook venvs using: PEP 723 > user config > requires-python from pyproject.toml > default (Any) (i.e. let uv decide). This works when the hook or repo explicitly declares its Python requirement, but doesn't handle transitive constraints — when a hook's deps require a narrower range than what's declared, or nothing is declared at all.
Example: hook foo has no requires-python, but its dep bar requires >=3.10. prek can't know this upfront, so uv's default version selection is used when calling uv venv create. Depending on previously installed uv versions, the venv may be created with a Python that's too old and uv pip install fails.
uv handles this in uvx/uv tool install via refine_interpreter(): when resolution fails with NoSolution, it extracts a Python bound from the error, recreates the environment, and retries. The retry is cheap since uv's HTTP cache already has all the metadata from the failed attempt. It's heuristic and can miss edge cases, but prek could adopt the same pattern as a fallback.
changed the title [-]Infer Python version from resolver errors and retry venv creation[/-][+]Retry with inferred Python constraint on uv pip install failure[/+]on Feb 10, 2026
Activity
[-]Infer Python version from resolver errors and retry venv creation[/-][+]Retry with inferred Python constraint on uv pip install failure[/+]Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint
Retry uv pip install with an inferred Python constraint