Replace actions/setup-python with astral-sh/setup-uv
MSALReplace actions/setup-python action with astral-sh/setup-uv action for faster Python environment setup and dependency management.
Benefits of UV:
- Significantly faster package installation and environment setup
- Built-in dependency resolution and locking
- Integrated caching for improved CI performance
- Drop-in replacement for pip workflows
Transformations applied:
actions/setup-python@v5→astral-sh/setup-uv@v6cache: 'pip'→enable-cache: 'true'pip install -r requirements.txt→uv sync(configurable strategy)python -m <module>→uv run <module>- Removes unnecessary
pip install --upgrade pipsteps
Sync strategies:
basic: Basic synchronization (uv sync)locked: Use locked dependencies (uv sync --locked)full: Install all extras and dev dependencies (uv sync --all-extras --dev)
See the UV GitHub integration guide for more details.
org. openrewrite. github. SetupPythonToUvOptional
The version of the astral-sh/setup-uv action to use. Defaults to v6.
Strategy for the uv sync command replacement.
Whether to transform pip install commands to uv equivalents:
pip install -r requirements.txt→uv syncpip install .→uv syncpython -m pytest→uv run pytest
When disabled, only the action itself is replaced. Defaults to true.
Whether to automatically convert cache: 'pip' to enable-cache: 'true' for UV's built-in caching. When disabled, cache settings are left unchanged. Defaults to true.
mod run . --recipe= org. openrewrite. github. SetupPythonToUvInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.