Upgrade to Python 3.10
ProprietaryMigrate deprecated APIs and adopt new syntax for Python 3.10 compatibility. This includes adopting PEP 604 union type syntax (X | Y) and other modernizations between Python 3.9 and 3.10.
org. openrewrite. python. migrate. UpgradeToPython310mod run . --recipe= org. openrewrite. python. migrate. UpgradeToPython310Install it once, 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.
- 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