Upgrade to Python 3.13

Proprietary

Migrate deprecated and removed APIs for Python 3.13 compatibility. This includes detecting usage of modules removed in PEP 594 ('dead batteries'), other API changes between Python 3.12 and 3.13, bumping ruff past the pinned releases that do not install cleanly on Python 3.13, and replacing the deprecated avro-python3 with Apache avro.

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

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.12
  2. Replace locale.resetlocale() with locale.setlocale(LC_ALL, '')
  3. Replace pipes.quote() with shlex.quote()
  4. Find deprecated aifc module usage
  5. Find deprecated audioop module usage
  6. Find deprecated cgi module usage
  7. Find deprecated cgitb module usage
  8. Find deprecated chunk module usage
  9. Find deprecated crypt module usage
  10. Find deprecated imghdr module usage
  11. Find deprecated mailcap module usage
  12. Find deprecated msilib module usage
  13. Find deprecated nis module usage
  14. Find deprecated nntplib module usage
  15. Find deprecated ossaudiodev module usage
  16. Find deprecated pipes module usage
  17. Find deprecated sndhdr module usage
  18. Find deprecated spwd module usage
  19. Find deprecated sunau module usage
  20. Find deprecated telnetlib module usage
  21. Find deprecated uu module usage
  22. Find deprecated xdrlib module usage
  23. Replace array 'u' typecode with 'w'
  24. Find array 'u' typecode
  25. org.openrewrite.python.UpgradeDependencyVersion
  26. Migrate the deprecated avro-python3 package to avro
  27. org.openrewrite.python.migrate.UpgradePythonVersionTo313