openrewrite-migrate-python 0.31.0__tar.gz → 0.33.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/PKG-INFO +2 -2
  2. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/pyproject.toml +2 -2
  3. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/pandas_cleanup.py +3 -1
  4. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/importlib_deprecations.py +1 -14
  5. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python.egg-info/PKG-INFO +2 -2
  6. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python.egg-info/requires.txt +1 -1
  7. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_backoff_to_tenacity.py +16 -37
  8. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_cgi_escape_deprecations.py +0 -40
  9. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_distutils_migrations.py +0 -2
  10. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_inspect_deprecations.py +1 -4
  11. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_langchain_classic_imports.py +0 -3
  12. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_mock_assertions.py +0 -5
  13. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_platform_deprecations.py +1 -4
  14. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pydantic_deprecations.py +0 -6
  15. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pydantic_model_fields.py +0 -2
  16. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_string_formatting.py +0 -35
  17. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_sys_deprecations.py +2 -7
  18. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_sys_last_deprecations.py +0 -22
  19. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_typing_union_to_pipe.py +9 -17
  20. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/setup.cfg +0 -0
  21. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/__init__.py +0 -0
  22. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/__init__.py +0 -0
  23. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/_literals.py +0 -0
  24. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/_negation.py +0 -0
  25. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/assign_return.py +0 -0
  26. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/attr_access.py +0 -0
  27. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/boolean_simplification.py +0 -0
  28. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/collection_literals.py +0 -0
  29. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/comparison_simplification.py +0 -0
  30. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/complex_transforms.py +0 -0
  31. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/comprehension_cleanup.py +0 -0
  32. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/conditionals.py +0 -0
  33. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/datetime_cleanup.py +0 -0
  34. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/dict_cleanup.py +0 -0
  35. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/exception_cleanup.py +0 -0
  36. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/expression_simplification.py +0 -0
  37. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/logger_warn.py +0 -0
  38. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/loop_cleanup.py +0 -0
  39. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/merge_nested_with.py +0 -0
  40. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/merge_startswith_endswith.py +0 -0
  41. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/naming_conventions.py +0 -0
  42. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/negated_operators.py +0 -0
  43. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/none_and_identity.py +0 -0
  44. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/object_inheritance.py +0 -0
  45. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/python_best_practices.py +0 -0
  46. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/range_cleanup.py +0 -0
  47. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/redundant_code.py +0 -0
  48. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/remove_trailing_return_none.py +0 -0
  49. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/string_cleanup.py +0 -0
  50. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/unreachable_code.py +0 -0
  51. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/use_items.py +0 -0
  52. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/use_list_clear.py +0 -0
  53. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/cleanup/yoda_conditions.py +0 -0
  54. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/__init__.py +0 -0
  55. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/_grouping.py +0 -0
  56. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/_reindent.py +0 -0
  57. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/_semantically_equal.py +0 -0
  58. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/_side_effects.py +0 -0
  59. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/_trivia.py +0 -0
  60. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/_truth_value.py +0 -0
  61. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/all_branches_identical.py +0 -0
  62. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/boolean_checks_not_inverted.py +0 -0
  63. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/code_quality.py +0 -0
  64. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/collapsible_if_statements.py +0 -0
  65. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/find_suspicious_chained_comparison.py +0 -0
  66. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/merge_identical_branches.py +0 -0
  67. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/remove_duplicate_conditions.py +0 -0
  68. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/remove_self_assignment.py +0 -0
  69. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/remove_unconditional_value_overwrite.py +0 -0
  70. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/simplify_boolean_literal.py +0 -0
  71. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_code_quality_python/codequality/simplify_redundant_logical_expression.py +0 -0
  72. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/__init__.py +0 -0
  73. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/__init__.py +0 -0
  74. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/_decorators.py +0 -0
  75. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/_finders.py +0 -0
  76. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/_langchain_tables.py +0 -0
  77. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/_markers.py +0 -0
  78. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/_method_renames.py +0 -0
  79. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/_module_imports.py +0 -0
  80. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/_slots.py +0 -0
  81. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/aifc_migrations.py +0 -0
  82. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/array_deprecations.py +0 -0
  83. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/ast_deprecations.py +0 -0
  84. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/asyncio_coroutine_to_async.py +0 -0
  85. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/asyncio_deprecations.py +0 -0
  86. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/avro_migrations.py +0 -0
  87. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/backoff_to_tenacity.py +0 -0
  88. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/builtins_deprecations.py +0 -0
  89. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/calendar_deprecations.py +0 -0
  90. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/cgi_escape_deprecations.py +0 -0
  91. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/cgi_migrations.py +0 -0
  92. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/cgi_parse_deprecations.py +0 -0
  93. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/collections_abc_migrations.py +0 -0
  94. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/configparser_deprecations.py +0 -0
  95. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/ctypes_deprecations.py +0 -0
  96. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/datetime_utc.py +0 -0
  97. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/distutils_deprecations.py +0 -0
  98. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/distutils_migrations.py +0 -0
  99. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/functools_deprecations.py +0 -0
  100. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/future_imports.py +0 -0
  101. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/gettext_deprecations.py +0 -0
  102. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/glob_deprecations.py +0 -0
  103. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/html_parser_deprecations.py +0 -0
  104. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/http_server_deprecations.py +0 -0
  105. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/imp_migrations.py +0 -0
  106. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/importlib_resources_deprecations.py +0 -0
  107. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/inspect_deprecations.py +0 -0
  108. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/langchain_classic_imports.py +0 -0
  109. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/langchain_community_imports.py +0 -0
  110. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/langchain_provider_imports.py +0 -0
  111. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/locale_deprecations.py +0 -0
  112. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/locale_getdefaultlocale_deprecation.py +0 -0
  113. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/macpath_deprecations.py +0 -0
  114. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/mailcap_migrations.py +0 -0
  115. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/mock_assertions.py +0 -0
  116. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/module_cached_attribute.py +0 -0
  117. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/nntplib_migrations.py +0 -0
  118. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/os_deprecations.py +0 -0
  119. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/pathlib_deprecations.py +0 -0
  120. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/pep594_system_migrations.py +0 -0
  121. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/pipes_migrations.py +0 -0
  122. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/pkgutil_deprecations.py +0 -0
  123. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/platform_deprecations.py +0 -0
  124. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/profile_deprecations.py +0 -0
  125. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/pydantic_deprecations.py +0 -0
  126. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/pydantic_fields.py +0 -0
  127. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/pydantic_model_fields.py +0 -0
  128. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/re_deprecations.py +0 -0
  129. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/removed_modules_312.py +0 -0
  130. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/shutil_deprecations.py +0 -0
  131. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/socket_deprecations.py +0 -0
  132. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/sre_migrations.py +0 -0
  133. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/ssl_deprecations.py +0 -0
  134. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/string_formatting.py +0 -0
  135. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/sys_deprecations.py +0 -0
  136. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/sys_last_deprecations.py +0 -0
  137. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/tarfile_deprecations.py +0 -0
  138. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/telnetlib_migrations.py +0 -0
  139. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/tempfile_deprecations.py +0 -0
  140. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/text_encoding.py +0 -0
  141. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/threading_deprecations.py +0 -0
  142. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/threading_is_alive_deprecation.py +0 -0
  143. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/types_deprecations.py +0 -0
  144. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/typing_callable.py +0 -0
  145. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/typing_deprecations.py +0 -0
  146. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/typing_functional_syntax.py +0 -0
  147. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/typing_union_to_pipe.py +0 -0
  148. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/unittest_deprecations.py +0 -0
  149. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_langchain02.py +0 -0
  150. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_langchain1.py +0 -0
  151. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_pandas.py +0 -0
  152. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_pydantic.py +0 -0
  153. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python310.py +0 -0
  154. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python311.py +0 -0
  155. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python312.py +0 -0
  156. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python313.py +0 -0
  157. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python314.py +0 -0
  158. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python315.py +0 -0
  159. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python38.py +0 -0
  160. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/upgrade_to_python39.py +0 -0
  161. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/urllib_deprecations.py +0 -0
  162. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/uu_migrations.py +0 -0
  163. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/wave_deprecations.py +0 -0
  164. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/webbrowser_deprecations.py +0 -0
  165. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/xdrlib_migrations.py +0 -0
  166. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python/migrate/xml_deprecations.py +0 -0
  167. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python.egg-info/SOURCES.txt +0 -0
  168. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python.egg-info/dependency_links.txt +0 -0
  169. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python.egg-info/entry_points.txt +0 -0
  170. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/src/openrewrite_migrate_python.egg-info/top_level.txt +0 -0
  171. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_aifc_migrations.py +0 -0
  172. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_array_deprecations.py +0 -0
  173. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_ast_deprecations.py +0 -0
  174. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_asyncio_coroutine_to_async.py +0 -0
  175. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_asyncio_deprecations.py +0 -0
  176. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_avro_migrations.py +0 -0
  177. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_builtins_deprecations.py +0 -0
  178. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_calendar_deprecations.py +0 -0
  179. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_cgi_parse_deprecations.py +0 -0
  180. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_change_import_recipes.py +0 -0
  181. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_collections_abc_migrations.py +0 -0
  182. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_configparser_deprecations.py +0 -0
  183. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_ctypes_deprecations.py +0 -0
  184. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_datetime_utc.py +0 -0
  185. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_distutils_deprecations.py +0 -0
  186. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_functools_deprecations.py +0 -0
  187. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_future_imports.py +0 -0
  188. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_gettext_deprecations.py +0 -0
  189. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_glob_deprecations.py +0 -0
  190. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_html_parser_deprecations.py +0 -0
  191. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_http_server_deprecations.py +0 -0
  192. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_imp_migrations.py +0 -0
  193. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_importlib_deprecations.py +0 -0
  194. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_importlib_resources_deprecations.py +0 -0
  195. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_langchain_community_imports.py +0 -0
  196. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_langchain_provider_imports.py +0 -0
  197. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_locale_deprecations.py +0 -0
  198. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_locale_getdefaultlocale_deprecation.py +0 -0
  199. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_macpath_deprecations.py +0 -0
  200. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_mailcap_migrations.py +0 -0
  201. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_module_cached_attribute.py +0 -0
  202. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_os_deprecations.py +0 -0
  203. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pathlib_deprecations.py +0 -0
  204. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pep594_migrations.py +0 -0
  205. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pep594_system_migrations.py +0 -0
  206. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pipes_migrations.py +0 -0
  207. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pkgutil_deprecations.py +0 -0
  208. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_profile_deprecations.py +0 -0
  209. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_pydantic_fields.py +0 -0
  210. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_re_deprecations.py +0 -0
  211. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_recipe_conventions.py +0 -0
  212. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_recipe_reachability.py +0 -0
  213. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_removed_modules_312.py +0 -0
  214. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_shutil_deprecations.py +0 -0
  215. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_socket_deprecations.py +0 -0
  216. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_sre_migrations.py +0 -0
  217. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_ssl_deprecations.py +0 -0
  218. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_tarfile_deprecations.py +0 -0
  219. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_tempfile_deprecations.py +0 -0
  220. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_text_encoding.py +0 -0
  221. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_threading_deprecations.py +0 -0
  222. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_threading_extended.py +0 -0
  223. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_threading_is_alive_deprecation.py +0 -0
  224. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_types_deprecations.py +0 -0
  225. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_typing_alias_moves.py +0 -0
  226. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_typing_callable.py +0 -0
  227. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_typing_deprecations.py +0 -0
  228. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_typing_functional_syntax.py +0 -0
  229. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_unittest_deprecations.py +0 -0
  230. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_upgrade_recipes.py +0 -0
  231. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_upgrade_to_pydantic.py +0 -0
  232. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_urllib_deprecations.py +0 -0
  233. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_wave_deprecations.py +0 -0
  234. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_webbrowser_deprecations.py +0 -0
  235. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_xdrlib_migrations.py +0 -0
  236. {openrewrite_migrate_python-0.31.0 → openrewrite_migrate_python-0.33.0}/tests/test_xml_deprecations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openrewrite-migrate-python
3
- Version: 0.31.0
3
+ Version: 0.33.0
4
4
  Summary: OpenRewrite recipes for migrating Python codebases to newer Python versions.
5
5
  Author-email: "Moderne Inc." <support@moderne.io>
6
6
  License: Moderne Proprietary
@@ -19,7 +19,7 @@ Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.12
20
20
  Description-Content-Type: text/markdown
21
21
  Provides-Extra: dev
22
- Requires-Dist: openrewrite>=8.96.3; extra == "dev"
22
+ Requires-Dist: openrewrite>=8.108.1; extra == "dev"
23
23
  Requires-Dist: pydantic>=2.11; extra == "dev"
24
24
  Requires-Dist: pytest>=8.0.0; extra == "dev"
25
25
  Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "openrewrite-migrate-python"
7
7
  description = "OpenRewrite recipes for migrating Python codebases to newer Python versions."
8
- version = "0.31.0" # Updated dynamically during release
8
+ version = "0.33.0" # Updated dynamically during release
9
9
  authors = [{ name = "Moderne Inc.", email = "support@moderne.io" }]
10
10
  license = { text = "Moderne Proprietary" }
11
11
  readme = "README.md"
@@ -28,7 +28,7 @@ dependencies = []
28
28
 
29
29
  [project.optional-dependencies]
30
30
  dev = [
31
- "openrewrite>=8.96.3",
31
+ "openrewrite>=8.108.1",
32
32
  # Needed so type-attribution tests can resolve `pydantic` types.
33
33
  "pydantic>=2.11",
34
34
  "pytest>=8.0.0",
@@ -36,7 +36,9 @@ _SERIES = "pandas.core.series.Series"
36
36
 
37
37
  _df = capture('df')
38
38
  _x = capture('x')
39
- _concat_template = template(f"pd.concat([{_df}, {_x}])", context=["import pandas as pd"])
39
+ _concat_template = template(
40
+ f"pd.concat([{_df}, {_x}])", context=["import pandas as pd"], dependencies={"pandas": ">=2"}
41
+ )
40
42
 
41
43
 
42
44
  @categorize(_Cleanup)
@@ -8,7 +8,6 @@ calls `load_module()` on a custom loader.
8
8
  See: https://docs.python.org/3/whatsnew/3.15.html#removed
9
9
  """
10
10
 
11
- from dataclasses import replace
12
11
  from typing import Any, List
13
12
 
14
13
  from rewrite import Cursor, ExecutionContext, Preconditions, Recipe, TreeVisitor
@@ -16,10 +15,8 @@ from rewrite.category import CategoryDescriptor
16
15
  from rewrite.decorators import categorize
17
16
  from rewrite.marketplace import Python
18
17
  from rewrite.java.tree import ClassDeclaration, J, MethodDeclaration, MethodInvocation
19
- from rewrite.preconditions import RecipeRef
20
18
  from rewrite.python.method_matcher import MethodMatcher
21
19
  from rewrite.python.preconditions import uses_method, uses_type
22
- from rewrite.python.search import UsesType
23
20
  from rewrite.python.type_utils import is_assignable_to
24
21
  from rewrite.python.visitor import PythonVisitor
25
22
 
@@ -37,16 +34,6 @@ def _is_loader(type_: Any) -> bool:
37
34
  return any(is_assignable_to(loader, type_) for loader in _LOADER_TYPES)
38
35
 
39
36
 
40
- def _uses_loader_type(loader: str) -> RecipeRef:
41
- """``uses_type(loader, check_assignability=True)``, evaluated in-process without the flag.
42
-
43
- The host evaluates ``HasType`` with ``checkAssignability`` either way. In-process, openrewrite
44
- 8.94.0's ``UsesType`` with the flag raises a ``TypeError`` on a call whose method type has no
45
- parameter types, as ``Registry()`` has for a class without ``__init__``.
46
- """
47
- return replace(uses_type(loader, check_assignability=True), local_visitor=UsesType(loader))
48
-
49
-
50
37
  def _declaring_class(cursor: Cursor) -> ClassDeclaration | None:
51
38
  """The class whose body declares the method ``cursor`` stands on, None for a nested function."""
52
39
  enclosing = cursor.parent
@@ -143,6 +130,6 @@ class FindLoaderLoadModule(Recipe):
143
130
 
144
131
  gate = Preconditions.or_(
145
132
  *(uses_method(p, match_overrides=True) for p in _LOAD_MODULE_PATTERNS),
146
- *(_uses_loader_type(loader) for loader in _LOADER_TYPES),
133
+ *(uses_type(loader, check_assignability=True) for loader in _LOADER_TYPES),
147
134
  )
148
135
  return Preconditions.check(gate, Visitor())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openrewrite-migrate-python
3
- Version: 0.31.0
3
+ Version: 0.33.0
4
4
  Summary: OpenRewrite recipes for migrating Python codebases to newer Python versions.
5
5
  Author-email: "Moderne Inc." <support@moderne.io>
6
6
  License: Moderne Proprietary
@@ -19,7 +19,7 @@ Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.12
20
20
  Description-Content-Type: text/markdown
21
21
  Provides-Extra: dev
22
- Requires-Dist: openrewrite>=8.96.3; extra == "dev"
22
+ Requires-Dist: openrewrite>=8.108.1; extra == "dev"
23
23
  Requires-Dist: pydantic>=2.11; extra == "dev"
24
24
  Requires-Dist: pytest>=8.0.0; extra == "dev"
25
25
  Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
@@ -1,6 +1,6 @@
1
1
 
2
2
  [dev]
3
- openrewrite>=8.96.3
3
+ openrewrite>=8.108.1
4
4
  pydantic>=2.11
5
5
  pytest>=8.0.0
6
6
  pytest-cov>=4.0.0
@@ -9,13 +9,14 @@ the wild rather than one invented for the test.
9
9
 
10
10
  from pathlib import Path
11
11
  from textwrap import dedent
12
+ from typing import Callable
12
13
 
13
14
  import pytest
14
15
  from rewrite import InMemoryExecutionContext, InMemoryLargeSourceSet, Recipe
15
16
  from rewrite.data_table import DATA_TABLE_STORE, InMemoryDataTableStore
16
17
  from rewrite.rpc import RpcRecipe
17
18
  from rewrite.test import RecipeSpec, python
18
- from tests._after_recipe import assert_idempotent
19
+ from rewrite.tree import SourceFile
19
20
  from tests._composites import native_steps
20
21
 
21
22
  from openrewrite_migrate_python.migrate import (
@@ -39,6 +40,16 @@ def _find() -> RecipeSpec:
39
40
  return RecipeSpec(recipe=FindBackoffDecoratorsNotMigrated())
40
41
 
41
42
 
43
+ def _assert_unchanged_by(recipe: Recipe) -> Callable[[SourceFile], None]:
44
+ def check(source_file: SourceFile) -> None:
45
+ for result in recipe.run(InMemoryLargeSourceSet([source_file]), InMemoryExecutionContext()):
46
+ after = result._after
47
+ assert after is None or after is result._before, (
48
+ f"{recipe.name} changed the result:\n{after.print_all()}"
49
+ )
50
+ return check
51
+
52
+
42
53
  def _with_helpers(helpers: str, imports: str, body: str) -> str:
43
54
  """The file a decorator needing one or more of the recipe's helpers is rewritten to.
44
55
 
@@ -1670,7 +1681,7 @@ class TestSplattedSettings:
1670
1681
  pass
1671
1682
  """,
1672
1683
  lambda actual: None,
1673
- after_recipe=assert_idempotent(ReplaceBackoffDecoratorsWithTenacity()),
1684
+ after_recipe=_assert_unchanged_by(ReplaceBackoffDecoratorsWithTenacity()),
1674
1685
  ))
1675
1686
 
1676
1687
  def test_a_dict_the_file_mutates_is_not_relied_on(self):
@@ -2685,33 +2696,7 @@ class TestFindNotMigrated:
2685
2696
 
2686
2697
 
2687
2698
  class TestIdempotence:
2688
- """`rewrite_run` drives one cycle; a run applies the recipe until nothing changes."""
2689
-
2690
- def test_a_second_run_adds_no_helper_and_no_decorator(self):
2691
- _spec().rewrite_run(python(
2692
- """
2693
- import backoff
2694
-
2695
- @backoff.on_exception(backoff.expo, IOError, max_time=30, on_backoff=h1)
2696
- def fetch():
2697
- pass
2698
- """,
2699
- lambda actual: None,
2700
- after_recipe=assert_idempotent(ReplaceBackoffDecoratorsWithTenacity()),
2701
- ))
2702
-
2703
- def test_the_search_marks_each_decorator_once(self):
2704
- _find().rewrite_run(python(
2705
- """
2706
- import backoff
2707
-
2708
- @backoff.on_exception(backoff.expo, IOError, **overrides)
2709
- def fetch():
2710
- pass
2711
- """,
2712
- lambda actual: None,
2713
- after_recipe=assert_idempotent(FindBackoffDecoratorsNotMigrated()),
2714
- ))
2699
+ """`rewrite_run`'s second cycle checks the tree, not the rows a second run writes."""
2715
2700
 
2716
2701
  def test_a_second_search_reports_no_decorator_again(self):
2717
2702
  def rerun_writes_no_rows(source_file):
@@ -2923,14 +2908,8 @@ class TestCompositeStructure:
2923
2908
  }
2924
2909
 
2925
2910
  def test_the_composite_settles_in_one_cycle(self):
2926
- """Nothing here needs to read an earlier step's output, so no step may ask for a cycle.
2927
-
2928
- Read with a default because hosts before openrewrite 8.93.0 have no such property.
2929
- """
2930
- assert not any(
2931
- getattr(r, "causes_another_cycle", False)
2932
- for r in MigrateBackoffToTenacity().recipe_list()
2933
- )
2911
+ # Nothing here needs to read an earlier step's output, so no step may ask for a cycle.
2912
+ assert not any(r.causes_another_cycle for r in MigrateBackoffToTenacity().recipe_list())
2934
2913
 
2935
2914
  def test_nothing_in_the_composite_removes_backoff(self):
2936
2915
  """A declined decorator still needs backoff, so nothing here may drop it."""
@@ -2,7 +2,6 @@
2
2
 
3
3
  from rewrite.test import RecipeSpec, python
4
4
 
5
- from tests._after_recipe import assert_idempotent
6
5
  from openrewrite_migrate_python.migrate.cgi_escape_deprecations import _MANUAL, ReplaceCgiEscape
7
6
 
8
7
 
@@ -193,25 +192,6 @@ class TestReplaceCgiEscape:
193
192
  )
194
193
  )
195
194
 
196
- def test_marking_is_idempotent(self):
197
- recipe = ReplaceCgiEscape()
198
- spec = RecipeSpec(recipe=recipe)
199
- spec.rewrite_run(
200
- python(
201
- """
202
- import cgi
203
- escaper = cgi.escape
204
- safe = cgi.escape(text)
205
- """,
206
- """
207
- import cgi
208
- escaper = /*~~({_MANUAL})~~>*/cgi.escape
209
- safe = cgi.escape(text)
210
- """.replace("{_MANUAL}", _MANUAL),
211
- after_recipe=assert_idempotent(recipe),
212
- )
213
- )
214
-
215
195
  def test_no_change_when_cgi_escape_is_never_called(self):
216
196
  spec = RecipeSpec(recipe=ReplaceCgiEscape())
217
197
  spec.rewrite_run(
@@ -236,23 +216,3 @@ class TestReplaceCgiEscape:
236
216
  """
237
217
  )
238
218
  )
239
-
240
- def test_is_idempotent(self):
241
- spec = RecipeSpec(recipe=ReplaceCgiEscape())
242
-
243
- def rerun(source_file):
244
- spec.rewrite_run(python(source_file.print_all()))
245
-
246
- spec.rewrite_run(
247
- python(
248
- """
249
- import cgi
250
- safe = cgi.escape(text)
251
- """,
252
- """
253
- import html
254
- safe = html.escape(text, quote=False)
255
- """,
256
- after_recipe=rerun,
257
- )
258
- )
@@ -3,7 +3,6 @@
3
3
  from rewrite.test import RecipeSpec, python
4
4
 
5
5
  from openrewrite_migrate_python.migrate.distutils_migrations import ReplaceDistutilsVersion
6
- from tests._after_recipe import assert_idempotent
7
6
 
8
7
  _MARKER = (
9
8
  "/*~~(distutils.version is deprecated: Migrate to packaging.version.Version "
@@ -21,7 +20,6 @@ class TestReplaceDistutilsVersion:
21
20
  python(
22
21
  "from distutils.version import LooseVersion",
23
22
  f"{_MARKER}from distutils.version import LooseVersion",
24
- after_recipe=assert_idempotent(ReplaceDistutilsVersion()),
25
23
  ),
26
24
  python(
27
25
  "from distutils.version import StrictVersion",
@@ -3,15 +3,13 @@
3
3
  from rewrite.test import RecipeSpec, python
4
4
 
5
5
  from openrewrite_migrate_python.migrate.inspect_deprecations import FindInspectGetargspec
6
- from tests._after_recipe import assert_idempotent
7
6
 
8
7
 
9
8
  class TestFindInspectGetargspec:
10
9
  """`getfullargspec()` returns a differently shaped tuple, so the call is marked, not renamed."""
11
10
 
12
11
  def test_marks_a_call_and_skips_a_shadowing_parameter(self):
13
- recipe = FindInspectGetargspec()
14
- RecipeSpec(recipe=recipe).rewrite_run(
12
+ RecipeSpec(recipe=FindInspectGetargspec()).rewrite_run(
15
13
  python(
16
14
  """
17
15
  from inspect import getargspec
@@ -25,6 +23,5 @@ class TestFindInspectGetargspec:
25
23
  def f(inspect):
26
24
  return inspect.getargspec(func)
27
25
  """,
28
- after_recipe=assert_idempotent(recipe),
29
26
  )
30
27
  )
@@ -1,7 +1,6 @@
1
1
  """Tests for LangChain classic import and deprecated agent migration recipes."""
2
2
 
3
3
  from rewrite.test import RecipeSpec, python
4
- from tests._after_recipe import assert_idempotent
5
4
  from openrewrite_migrate_python.migrate.langchain_classic_imports import (
6
5
  FindDeprecatedLangchainAgents,
7
6
  ReplaceLangchainClassicImports,
@@ -120,7 +119,6 @@ class TestFindDeprecatedLangchainAgents:
120
119
  /*~~({_agents_msg(agents)})~~>*/from langchain.agents import {agents}
121
120
  /*~~({_agents_msg("LLMChain")})~~>*/from langchain.chains import LLMChain
122
121
  """,
123
- after_recipe=assert_idempotent(FindDeprecatedLangchainAgents()),
124
122
  )
125
123
  )
126
124
 
@@ -150,7 +148,6 @@ class TestFindLangchainCreateReactAgent:
150
148
  f"""
151
149
  /*~~({_REACT_AGENT_MSG})~~>*/from langgraph.prebuilt import create_react_agent
152
150
  """,
153
- after_recipe=assert_idempotent(FindLangchainCreateReactAgent()),
154
151
  )
155
152
  )
156
153
 
@@ -1,9 +1,6 @@
1
1
  from rewrite.test import RecipeSpec, python
2
2
 
3
3
  from openrewrite_migrate_python.migrate.mock_assertions import AddMockAssertPrefix
4
- from tests._after_recipe import assert_idempotent_and_parse_shape
5
-
6
- _check = assert_idempotent_and_parse_shape(AddMockAssertPrefix())
7
4
 
8
5
 
9
6
  class TestAddMockAssertPrefix:
@@ -27,7 +24,6 @@ class TestAddMockAssertPrefix:
27
24
  m.assert_called_once_with(1)
28
25
  self.popen.stdin.assert_has_calls([])
29
26
  """,
30
- after_recipe=_check,
31
27
  )
32
28
  )
33
29
 
@@ -50,7 +46,6 @@ class TestAddMockAssertPrefix:
50
46
  self.callback.assert_called_with(42, keyword='value')
51
47
  self.publisher.assert_called_once()
52
48
  """,
53
- after_recipe=_check,
54
49
  )
55
50
  )
56
51
 
@@ -3,15 +3,13 @@
3
3
  from rewrite.test import RecipeSpec, python
4
4
 
5
5
  from openrewrite_migrate_python.migrate.platform_deprecations import FindPlatformJavaVer, ReplacePlatformPopen
6
- from tests._after_recipe import assert_idempotent
7
6
 
8
7
 
9
8
  class TestReplacePlatformPopen:
10
9
  """Tests for ReplacePlatformPopen recipe."""
11
10
 
12
11
  def test_replaces_platform_popen(self):
13
- recipe = ReplacePlatformPopen()
14
- RecipeSpec(recipe=recipe).rewrite_run(
12
+ RecipeSpec(recipe=ReplacePlatformPopen()).rewrite_run(
15
13
  python(
16
14
  """
17
15
  import platform
@@ -21,7 +19,6 @@ class TestReplacePlatformPopen:
21
19
  import subprocess
22
20
  output = subprocess.check_output('ls', shell=True)
23
21
  """,
24
- after_recipe=assert_idempotent(recipe),
25
22
  )
26
23
  )
27
24
 
@@ -4,7 +4,6 @@ from pathlib import Path
4
4
 
5
5
  import pytest
6
6
  from rewrite.test import RecipeSpec, python
7
- from tests._after_recipe import assert_idempotent
8
7
 
9
8
  from openrewrite_migrate_python.migrate.pydantic_deprecations import (
10
9
  FindDeprecatedJsonEncoders,
@@ -447,7 +446,6 @@ class TestFindSerializeAsAnyUsage:
447
446
  data = u.model_dump(/*~~({_SERIALIZE_AS_ANY_MSG})~~>*/serialize_as_any=True)
448
447
  text = u.model_dump_json(/*~~({_SERIALIZE_AS_ANY_MSG})~~>*/serialize_as_any=True)
449
448
  """,
450
- after_recipe=assert_idempotent(FindSerializeAsAnyUsage()),
451
449
  )
452
450
  )
453
451
 
@@ -538,7 +536,6 @@ class TestFindEvalTypeBackportUsage:
538
536
  f"""
539
537
  /*~~({_EVAL_TYPE_BACKPORT_MSG})~~>*/import eval_type_backport
540
538
  """,
541
- after_recipe=assert_idempotent(FindEvalTypeBackportUsage()),
542
539
  ),
543
540
  python(
544
541
  """
@@ -586,7 +583,6 @@ class TestFindDeprecatedSchemaGenerator:
586
583
  class User(BaseModel):
587
584
  model_config = ConfigDict(/*~~({_SCHEMA_GEN_MSG})~~>*/schema_generator=MyGen)
588
585
  """,
589
- after_recipe=assert_idempotent(FindDeprecatedSchemaGenerator()),
590
586
  )
591
587
  )
592
588
 
@@ -638,7 +634,6 @@ class TestFindDeprecatedJsonEncoders:
638
634
  class User(BaseModel):
639
635
  model_config = ConfigDict(/*~~({_JSON_ENCODERS_MSG})~~>*/json_encoders={{int: str}})
640
636
  """,
641
- after_recipe=assert_idempotent(FindDeprecatedJsonEncoders()),
642
637
  )
643
638
  )
644
639
 
@@ -700,7 +695,6 @@ class TestFindModelValidatorAfterClassmethod:
700
695
  def check(cls, data):
701
696
  return data
702
697
  """,
703
- after_recipe=assert_idempotent(FindModelValidatorAfterClassmethod()),
704
698
  )
705
699
  )
706
700
 
@@ -5,7 +5,6 @@ from pathlib import Path
5
5
  import pytest
6
6
 
7
7
  from rewrite.test import RecipeSpec, python
8
- from tests._after_recipe import assert_idempotent
9
8
 
10
9
  from openrewrite_migrate_python.migrate.pydantic_model_fields import (
11
10
  ReplaceModelFieldsInstanceAccess,
@@ -39,7 +38,6 @@ class TestReplaceModelFieldsInstanceAccess:
39
38
  def field_names(self):
40
39
  return list(type(self).model_fields.keys())
41
40
  """,
42
- after_recipe=assert_idempotent(ReplaceModelFieldsInstanceAccess()),
43
41
  )
44
42
  )
45
43
 
@@ -5,7 +5,6 @@ import pytest
5
5
  from rewrite.python.visitor import PythonVisitor
6
6
  from rewrite.test import RecipeSpec, python
7
7
 
8
- from tests._after_recipe import assert_idempotent, assert_parse_shape
9
8
  from openrewrite_migrate_python.migrate.string_formatting import (
10
9
  ReplacePercentFormatWithFString,
11
10
  ReplaceStrFormatWithFString,
@@ -159,7 +158,6 @@ class TestReplaceStrFormatWithFString:
159
158
  """
160
159
  message = f"{{literal braces}}"
161
160
  """,
162
- after_recipe=assert_parse_shape,
163
161
  )
164
162
  )
165
163
 
@@ -443,21 +441,6 @@ class TestReplaceStrFormatWithFString:
443
441
  )
444
442
  )
445
443
 
446
- def test_idempotent(self):
447
- """Running the recipe twice produces the same result."""
448
- recipe = ReplaceStrFormatWithFString()
449
- spec = RecipeSpec(recipe=recipe)
450
- spec.rewrite_run(
451
- python(
452
- """
453
- message = "Hello {}".format(name)
454
- """,
455
- """
456
- message = f"Hello {name}"
457
- """,
458
- after_recipe=assert_idempotent(recipe),
459
- )
460
- )
461
444
 
462
445
  class TestReplacePercentFormatWithFString:
463
446
  """Tests for the ReplacePercentFormatWithFString recipe."""
@@ -734,21 +717,3 @@ class TestReplacePercentFormatWithFString:
734
717
  """,
735
718
  )
736
719
  )
737
-
738
- def test_idempotent(self):
739
- """Running the recipe twice produces the same result."""
740
- recipe = ReplacePercentFormatWithFString()
741
- spec = RecipeSpec(recipe=recipe)
742
- spec.rewrite_run(
743
- python(
744
- """
745
- name = "world"
746
- message = "Hello %s" % name
747
- """,
748
- """
749
- name = "world"
750
- message = f"Hello {name}"
751
- """,
752
- after_recipe=assert_idempotent(recipe),
753
- )
754
- )
@@ -3,21 +3,18 @@
3
3
  from rewrite.test import RecipeSpec, python
4
4
 
5
5
  from openrewrite_migrate_python.migrate.sys_deprecations import FindSysCheckInterval, FindSysCoroutineWrapper
6
- from tests._after_recipe import assert_idempotent
7
6
 
8
7
 
9
8
  class TestFindSysCoroutineWrapper:
10
9
  """Tests for FindSysCoroutineWrapper recipe."""
11
10
 
12
11
  def test_finds_both_functions(self):
13
- recipe = FindSysCoroutineWrapper()
14
- RecipeSpec(recipe=recipe).rewrite_run(
12
+ RecipeSpec(recipe=FindSysCoroutineWrapper()).rewrite_run(
15
13
  python(
16
14
  "import sys\nsys.set_coroutine_wrapper(wrapper)\nold = sys.get_coroutine_wrapper()",
17
15
  "import sys\n/*~~(sys.set_coroutine_wrapper() was removed in Python 3.8.)~~>*/"
18
16
  "sys.set_coroutine_wrapper(wrapper)\n"
19
17
  "old = /*~~(sys.get_coroutine_wrapper() was removed in Python 3.8.)~~>*/sys.get_coroutine_wrapper()",
20
- after_recipe=assert_idempotent(recipe),
21
18
  )
22
19
  )
23
20
 
@@ -35,8 +32,7 @@ class TestFindSysCheckInterval:
35
32
  """The switch interval is in seconds where the check interval counted instructions."""
36
33
 
37
34
  def test_marks_both_calls_and_skips_a_shadowing_parameter(self):
38
- recipe = FindSysCheckInterval()
39
- RecipeSpec(recipe=recipe).rewrite_run(
35
+ RecipeSpec(recipe=FindSysCheckInterval()).rewrite_run(
40
36
  python(
41
37
  """
42
38
  import sys
@@ -52,6 +48,5 @@ class TestFindSysCheckInterval:
52
48
  def f(sys):
53
49
  sys.setcheckinterval(100)
54
50
  """,
55
- after_recipe=assert_idempotent(recipe),
56
51
  )
57
52
  )
@@ -262,25 +262,3 @@ class TestReplaceSysLastExcInfo:
262
262
  """,
263
263
  )
264
264
  )
265
-
266
- def test_is_idempotent(self):
267
- spec = RecipeSpec(recipe=ReplaceSysLastExcInfo())
268
-
269
- def rerun(source_file):
270
- spec.rewrite_run(python(source_file.print_all()))
271
-
272
- spec.rewrite_run(
273
- python(
274
- """
275
- import sys
276
- if hasattr(sys, "last_type"):
277
- t = sys.last_type
278
- """,
279
- """
280
- import sys
281
- if hasattr(sys, "last_exc"):
282
- t = type(sys.last_exc)
283
- """,
284
- after_recipe=rerun,
285
- )
286
- )
@@ -3,7 +3,6 @@
3
3
  from rewrite.python.visitor import PythonVisitor
4
4
  from rewrite.test import RecipeSpec, python
5
5
 
6
- from tests._after_recipe import assert_idempotent_and_parse_shape, assert_parse_shape
7
6
  from openrewrite_migrate_python.migrate.typing_union_to_pipe import (
8
7
  ReplaceTypingOptionalWithUnion,
9
8
  ReplaceTypingUnionWithPipe,
@@ -15,15 +14,15 @@ def _assert_built_nodes_typed(source_file):
15
14
  untyped = []
16
15
 
17
16
  class Collect(PythonVisitor):
18
- def visit_literal(self, node, p):
19
- if node.type is None:
20
- untyped.append(type(node).__name__)
21
- return super().visit_literal(node, p)
17
+ def visit_literal(self, literal, p):
18
+ if literal.type is None:
19
+ untyped.append(type(literal).__name__)
20
+ return super().visit_literal(literal, p)
22
21
 
23
- def visit_union_type(self, node, p):
24
- if node.type is None:
25
- untyped.append(type(node).__name__)
26
- return super().visit_union_type(node, p)
22
+ def visit_union_type(self, union, p):
23
+ if union.type is None:
24
+ untyped.append(type(union).__name__)
25
+ return super().visit_union_type(union, p)
27
26
 
28
27
  Collect().visit(source_file, None)
29
28
  assert not untyped, f"Nodes without a type: {untyped}"
@@ -75,7 +74,6 @@ class TestReplaceTypingOptionalWithUnion:
75
74
  """
76
75
  name: str | None = None
77
76
  """,
78
- after_recipe=assert_parse_shape,
79
77
  )
80
78
  )
81
79
 
@@ -90,7 +88,6 @@ class TestReplaceTypingOptionalWithUnion:
90
88
  """
91
89
  MaybeInt = int | None
92
90
  """,
93
- after_recipe=assert_parse_shape,
94
91
  )
95
92
  )
96
93
 
@@ -324,7 +321,6 @@ class TestReplaceTypingUnionWithPipe:
324
321
  """
325
322
  value: int | str | float = 0
326
323
  """,
327
- after_recipe=assert_parse_shape,
328
324
  )
329
325
  )
330
326
 
@@ -339,7 +335,6 @@ class TestReplaceTypingUnionWithPipe:
339
335
  """
340
336
  Scalar = int | str | None
341
337
  """,
342
- after_recipe=assert_parse_shape,
343
338
  )
344
339
  )
345
340
 
@@ -547,8 +542,7 @@ class TestQuotedAnnotations:
547
542
  """A quoted annotation parses to type nodes marked `Quoted`, which print the quotes back."""
548
543
 
549
544
  def test_rewrites_quoted_optional(self):
550
- recipe = ReplaceTypingOptionalWithUnion()
551
- spec = RecipeSpec(recipe=recipe)
545
+ spec = RecipeSpec(recipe=ReplaceTypingOptionalWithUnion())
552
546
  spec.rewrite_run(
553
547
  python(
554
548
  """
@@ -564,7 +558,6 @@ class TestQuotedAnnotations:
564
558
  b: "Dict[str, int | None]" = {}
565
559
  c: "int | None" = None
566
560
  """,
567
- after_recipe=assert_idempotent_and_parse_shape(recipe),
568
561
  )
569
562
  )
570
563
 
@@ -579,7 +572,6 @@ class TestQuotedAnnotations:
579
572
  """
580
573
  a: "int | str | bytes" = 1
581
574
  """,
582
- after_recipe=assert_parse_shape,
583
575
  )
584
576
  )
585
577