Definition
Recipes13
- Upgrade to Python 3.9
- Replace
collectionsABC imports withcollections.abc - Replace
typing.Optional[X]withX | None - Replace
typing.Union[X, Y]withX | Y - Replace
threading.currentThread()withthreading.current_thread() - Replace
threading.activeCount()withthreading.active_count() - Replace
Condition.notifyAll()withCondition.notify_all() - Replace
Event.isSet()withEvent.is_set() - Replace
Thread.getName()withThread.name - Replace
Thread.setName()withThread.name = ... - Replace
Thread.isDaemon()withThread.daemon - Replace
Thread.setDaemon()withThread.daemon = ... - org.openrewrite.python.migrate.UpgradePythonVersionTo310
Usage
Run this recipe
In order to run Python recipes, you will need to use the Moderne CLI.
Once the CLI is installed, you can install this Python recipe package by running the following command:
Install the recipe package
mod config recipes pip install openrewrite-migrate-python==0.9.3
Then, you can run the recipe via:
Run the recipe
mod run . --recipe org.openrewrite.python.migrate.UpgradeToPython310