Upgrade to Python 3.14
Recipe ID
org.openrewrite.python.migrate.UpgradeToPython314Artifactopenrewrite-migrate-pythonMigrate deprecated and removed APIs for Python 3.14 compatibility. This includes replacing deprecated AST node types with ast.Constant and other API changes between Python 3.13 and 3.14.
Composite recipepythonmigration3.14Proprietary
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.UpgradeToPython314If 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.13
org.openrewrite.python.migrate.UpgradeToPython313 - Replace
array.tostring()witharray.tobytes()org.openrewrite.python.migrate.ReplaceArrayTostring - Replace
array.fromstring()witharray.frombytes()org.openrewrite.python.migrate.ReplaceArrayFromstring - Replace
ast.Numwithast.Constantorg.openrewrite.python.migrate.ReplaceAstNum - Replace
ast.Strwithast.Constantorg.openrewrite.python.migrate.ReplaceAstStr - Replace
ast.Byteswithast.Constantorg.openrewrite.python.migrate.ReplaceAstBytes - Replace
ast.NameConstantwithast.Constantorg.openrewrite.python.migrate.ReplaceAstNameConstant - Replace
ast.Ellipsiswithast.Constantorg.openrewrite.python.migrate.ReplaceAstEllipsis - Find deprecated
tempfile.mktemp()usageorg.openrewrite.python.migrate.FindTempfileMktemp - Find deprecated urllib.parse split functions
org.openrewrite.python.migrate.FindUrllibParseSplitFunctions - Find deprecated
urllib.parse.to_bytes()usageorg.openrewrite.python.migrate.FindUrllibParseToBytes - org.openrewrite.python.migrate.UpgradePythonVersionTo314
org.openrewrite.python.migrate.UpgradePythonVersionTo314