Upgrade Python version

Proprietary

Update the Python version referenced in project metadata, packaging, CI, documentation, and infrastructure files to a target version: pyproject.toml, Pipfile, setup.py, setup.cfg, .python-version, Ruff's target-version, Dockerfile base images, GitHub Actions setup-python steps, CloudFormation/SAM template runtimes, Read the Docs configuration, and Mend .whitesource files. Only references older than the target are changed. Each file type is handled by its own recipe, so a team with its own process for some of them can compose the rest.

org.openrewrite.python.migrate.UpgradePythonVersion

Required

The target Python version as MAJOR.MINOR (for example 3.12). Any patch component is dropped; the minor release is the upgrade target.

mod run . --recipe=org.openrewrite.python.migrate.UpgradePythonVersion \ -P version=3.12

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Upgrade Python version in project files
  2. Upgrade Python Docker base image
  3. Upgrade actions/setup-python python-version
  4. Upgrade Python runtime in CloudFormation templates
  5. Upgrade Python version in Read the Docs configuration
  6. Upgrade Python version in Mend .whitesource files