Upgrade to Python 3.11

Proprietary

Migrate deprecated and removed APIs for Python 3.11 compatibility. This includes handling removed modules, deprecated functions, and API changes between Python 3.10 and 3.11.

org.openrewrite.python.migrate.UpgradeToPython311
mod run . --recipe=org.openrewrite.python.migrate.UpgradeToPython311

Install 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.

  1. Upgrade to Python 3.10
  2. Replace typing.Text with str
  3. Find removed inspect.getargspec()
  4. Replace configparser.SafeConfigParser with ConfigParser
  5. Replace ConfigParser.readfp() with read_file()
  6. Replace deprecated gettext l*gettext() functions
  7. Change import
  8. Replace deprecated unittest method aliases
  9. Migrate @asyncio.coroutine to async def
  10. Find deprecated @asyncio.coroutine decorator
  11. Find socket.getfqdn() usage
  12. Find deprecated locale.getdefaultlocale() usage
  13. Replace re.template() with re.compile() and flag re.TEMPLATE/re.T
  14. org.openrewrite.python.migrate.UpgradePythonVersionTo311