Definition
Recipes20
20 recipes
- Upgrade to Python 3.14
- Replace
glob.glob1()withglob.glob(root_dir=...) - Replace keyword-argument
NamedTuplefields with a field list - Pass
[]to aNamedTuplewith no fields - Pass
{}to aTypedDictwith no fields - Replace
importlib.resources.files(package=...)withanchor=... - Replace module
__cached__with__spec__.cached - Find removed
glob.glob0() - Find removed
PurePath.is_reserved() - Find removed
load_module()on import loaders - Find removed
sre_*modules - Find removed
http.server.CGIHTTPRequestHandler - Find removed
typing.no_type_check_decorator - Find removed
ctypes.SetPointerType() - Find removed
platform.java_ver() - Find removed
wavemarker methods - Find removed
co_lnotabon code objects - Find deprecated
profilemodule - Find deprecated
webbrowser.MacOSXOSAScript - org.openrewrite.python.migrate.UpgradePythonVersionTo315
Usage
Run this recipe
In order to run Python recipes, you will need to use the Moderne CLI.
This recipe calls into other OpenRewrite packages as it runs. You will need to install all of the following packages before running it:
RELEASE resolves to the newest release and LATEST to the newest build of any kind, including snapshots. Either one lets mod config recipes upgrade pull in later versions without editing this command; a pinned version stays where you put it.
- RELEASE
- LATEST
- Pinned version
Install the recipe packages
mod config recipes pip install openrewrite-migrate-python
mod config recipes jar install org.openrewrite.recipe:rewrite-migrate-python:RELEASE
mod config recipes jar install org.openrewrite:rewrite-python:RELEASE
Install the recipe packages
mod config recipes pip install openrewrite-migrate-python
mod config recipes jar install org.openrewrite.recipe:rewrite-migrate-python:LATEST
mod config recipes jar install org.openrewrite:rewrite-python:LATEST
Install the recipe packages
mod config recipes pip install openrewrite-migrate-python==0.17.0
mod config recipes jar install org.openrewrite.recipe:rewrite-migrate-python:0.17.0
mod config recipes jar install org.openrewrite:rewrite-python:8.94.0
Then, you can run the recipe via:
Run the recipe
mod run . --recipe org.openrewrite.python.migrate.UpgradeToPython315