Upgrade to Python 3.13
Recipe ID
org.openrewrite.python.migrate.UpgradeToPython313Artifactopenrewrite-migrate-pythonMigrate deprecated and removed APIs for Python 3.13 compatibility. This includes detecting usage of modules removed in PEP 594 ('dead batteries'), other API changes between Python 3.12 and 3.13, and bumping third-party dependencies (ruff, avro-python3) whose pinned releases do not install cleanly on Python 3.13.
Composite recipepythonmigration3.13Proprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.python.migrate.UpgradeToPython313If the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-pythonDefinition
This recipe runs the following recipes in order.
- Upgrade to Python 3.12
org.openrewrite.python.migrate.UpgradeToPython312 - Replace
locale.resetlocale()withlocale.setlocale(LC_ALL, '')org.openrewrite.python.migrate.ReplaceLocaleResetlocale - Find deprecated
aifcmodule usageorg.openrewrite.python.migrate.FindAifcModule - Find deprecated
audioopmodule usageorg.openrewrite.python.migrate.FindAudioopModule - Find deprecated
cgimodule usageorg.openrewrite.python.migrate.FindCgiModule - Find deprecated
cgitbmodule usageorg.openrewrite.python.migrate.FindCgitbModule - Find deprecated
chunkmodule usageorg.openrewrite.python.migrate.FindChunkModule - Find deprecated
cryptmodule usageorg.openrewrite.python.migrate.FindCryptModule - Find deprecated
imghdrmodule usageorg.openrewrite.python.migrate.FindImghdrModule - Find deprecated
mailcapmodule usageorg.openrewrite.python.migrate.FindMailcapModule - Find deprecated
msilibmodule usageorg.openrewrite.python.migrate.FindMsilibModule - Find deprecated
nismodule usageorg.openrewrite.python.migrate.FindNisModule - Find deprecated
nntplibmodule usageorg.openrewrite.python.migrate.FindNntplibModule - Find deprecated
ossaudiodevmodule usageorg.openrewrite.python.migrate.FindOssaudiodevModule - Find deprecated
pipesmodule usageorg.openrewrite.python.migrate.FindPipesModule - Find deprecated
sndhdrmodule usageorg.openrewrite.python.migrate.FindSndhdrModule - Find deprecated
spwdmodule usageorg.openrewrite.python.migrate.FindSpwdModule - Find deprecated
sunaumodule usageorg.openrewrite.python.migrate.FindSunauModule - Find deprecated
telnetlibmodule usageorg.openrewrite.python.migrate.FindTelnetlibModule - Find deprecated
uumodule usageorg.openrewrite.python.migrate.FindUuModule - Find deprecated
xdrlibmodule usageorg.openrewrite.python.migrate.FindXdrlibModule - org.openrewrite.python.UpgradeDependencyVersion
org.openrewrite.python.UpgradeDependencyVersion - org.openrewrite.python.UpgradeDependencyVersion
org.openrewrite.python.UpgradeDependencyVersion - org.openrewrite.python.migrate.UpgradePythonVersionTo313
org.openrewrite.python.migrate.UpgradePythonVersionTo313