openrewrite-migrate-python 0.10.0.dev20260619173622__tar.gz → 0.10.0.dev20260620181905__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.
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/PKG-INFO +1 -1
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/pyproject.toml +1 -1
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/aifc_migrations.py +8 -7
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/ast_deprecations.py +7 -6
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/asyncio_coroutine_to_async.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/asyncio_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/calendar_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/cgi_migrations.py +4 -3
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/datetime_utc.py +4 -3
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/distutils_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/distutils_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/gettext_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/imp_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/locale_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/macpath_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/mailcap_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/nntplib_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/pep594_system_migrations.py +7 -6
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/pipes_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/pkgutil_deprecations.py +4 -3
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/removed_modules_312.py +8 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/ssl_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/sys_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/sys_last_deprecations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/telnetlib_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/uu_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/xdrlib_migrations.py +3 -2
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python.egg-info/PKG-INFO +1 -1
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_sys_deprecations.py +4 -4
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/setup.cfg +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/__init__.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/__init__.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/_semantically_equal.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/all_branches_identical.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/boolean_checks_not_inverted.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/collapsible_if_statements.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/merge_identical_branches.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/remove_duplicate_conditions.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/remove_self_assignment.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/remove_unconditional_value_overwrite.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/simplify_boolean_literal.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_code_quality_python/codequality/simplify_redundant_logical_expression.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/__init__.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/__init__.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/_markers.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/array_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/cgi_parse_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/collections_abc_migrations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/configparser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/functools_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/future_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/html_parser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/langchain_classic_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/langchain_community_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/langchain_provider_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/locale_getdefaultlocale_deprecation.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/os_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/pathlib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/platform_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/pydantic_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/pydantic_fields.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/pydantic_model_fields.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/re_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/shutil_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/socket_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/string_formatting.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/tarfile_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/tempfile_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/threading_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/threading_is_alive_deprecation.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/typing_callable.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/typing_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/typing_union_to_pipe.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/unittest_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_langchain02.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_langchain1.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_pydantic.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_python310.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_python311.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_python312.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_python313.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_python314.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_python38.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/upgrade_to_python39.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/urllib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python/migrate/xml_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python.egg-info/SOURCES.txt +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python.egg-info/dependency_links.txt +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python.egg-info/entry_points.txt +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python.egg-info/requires.txt +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/src/openrewrite_migrate_python.egg-info/top_level.txt +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_aifc_migrations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_array_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_ast_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_asyncio_coroutine_to_async.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_asyncio_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_calendar_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_cgi_parse_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_change_import_recipes.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_collections_abc_migrations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_configparser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_datetime_utc.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_distutils_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_future_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_gettext_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_html_parser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_imp_migrations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_langchain_classic_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_langchain_community_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_langchain_provider_imports.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_locale_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_locale_getdefaultlocale_deprecation.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_macpath_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_os_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_pep594_migrations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_pep594_system_migrations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_pkgutil_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_platform_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_pydantic_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_pydantic_fields.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_pydantic_model_fields.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_re_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_removed_modules_312.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_shutil_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_ssl_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_string_formatting.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_sys_last_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_tarfile_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_threading_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_threading_extended.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_threading_is_alive_deprecation.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_typing_callable.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_typing_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_typing_union_to_pipe.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_unittest_deprecations.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_upgrade_recipes.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/tests/test_upgrade_to_pydantic.py +0 -0
- {openrewrite_migrate_python-0.10.0.dev20260619173622 → openrewrite_migrate_python-0.10.0.dev20260620181905}/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.10.0.
|
|
3
|
+
Version: 0.10.0.dev20260620181905
|
|
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
|
|
@@ -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.10.0.
|
|
8
|
+
version = "0.10.0.dev20260620181905" # 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"
|
|
@@ -13,7 +13,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
13
13
|
|
|
14
14
|
from typing import Any, List, Optional
|
|
15
15
|
|
|
16
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
16
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.category import CategoryDescriptor
|
|
18
19
|
from rewrite.decorators import categorize
|
|
19
20
|
from rewrite.marketplace import Python
|
|
@@ -116,7 +117,7 @@ class FindAifcModule(Recipe):
|
|
|
116
117
|
)
|
|
117
118
|
return import_stmt
|
|
118
119
|
|
|
119
|
-
return Visitor()
|
|
120
|
+
return Preconditions.check(uses_import("aifc"), Visitor())
|
|
120
121
|
|
|
121
122
|
|
|
122
123
|
@categorize(_Python313)
|
|
@@ -194,7 +195,7 @@ class FindAudioopModule(Recipe):
|
|
|
194
195
|
)
|
|
195
196
|
return import_stmt
|
|
196
197
|
|
|
197
|
-
return Visitor()
|
|
198
|
+
return Preconditions.check(uses_import("audioop"), Visitor())
|
|
198
199
|
|
|
199
200
|
|
|
200
201
|
@categorize(_Python313)
|
|
@@ -266,7 +267,7 @@ class FindChunkModule(Recipe):
|
|
|
266
267
|
)
|
|
267
268
|
return import_stmt
|
|
268
269
|
|
|
269
|
-
return Visitor()
|
|
270
|
+
return Preconditions.check(uses_import("chunk"), Visitor())
|
|
270
271
|
|
|
271
272
|
|
|
272
273
|
@categorize(_Python313)
|
|
@@ -346,7 +347,7 @@ class FindImghdrModule(Recipe):
|
|
|
346
347
|
)
|
|
347
348
|
return import_stmt
|
|
348
349
|
|
|
349
|
-
return Visitor()
|
|
350
|
+
return Preconditions.check(uses_import("imghdr"), Visitor())
|
|
350
351
|
|
|
351
352
|
|
|
352
353
|
@categorize(_Python313)
|
|
@@ -425,7 +426,7 @@ class FindSndhdrModule(Recipe):
|
|
|
425
426
|
)
|
|
426
427
|
return import_stmt
|
|
427
428
|
|
|
428
|
-
return Visitor()
|
|
429
|
+
return Preconditions.check(uses_import("sndhdr"), Visitor())
|
|
429
430
|
|
|
430
431
|
|
|
431
432
|
@categorize(_Python313)
|
|
@@ -504,4 +505,4 @@ class FindSunauModule(Recipe):
|
|
|
504
505
|
)
|
|
505
506
|
return import_stmt
|
|
506
507
|
|
|
507
|
-
return Visitor()
|
|
508
|
+
return Preconditions.check(uses_import("sunau"), Visitor())
|
|
@@ -16,10 +16,11 @@ See: https://docs.python.org/3/library/ast.html#ast.Constant
|
|
|
16
16
|
|
|
17
17
|
from typing import Any, Optional
|
|
18
18
|
|
|
19
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
19
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
20
20
|
from rewrite.category import CategoryDescriptor
|
|
21
21
|
from rewrite.decorators import categorize
|
|
22
22
|
from rewrite.marketplace import Python
|
|
23
|
+
from rewrite.python.preconditions import uses_import
|
|
23
24
|
from rewrite.python.visitor import PythonVisitor
|
|
24
25
|
from rewrite.java.tree import Identifier, FieldAccess
|
|
25
26
|
|
|
@@ -118,7 +119,7 @@ class ReplaceAstNum(Recipe):
|
|
|
118
119
|
|
|
119
120
|
return field_access
|
|
120
121
|
|
|
121
|
-
return Visitor()
|
|
122
|
+
return Preconditions.check(uses_import("ast"), Visitor())
|
|
122
123
|
|
|
123
124
|
|
|
124
125
|
@categorize(_Python38)
|
|
@@ -168,7 +169,7 @@ class ReplaceAstStr(Recipe):
|
|
|
168
169
|
|
|
169
170
|
return field_access
|
|
170
171
|
|
|
171
|
-
return Visitor()
|
|
172
|
+
return Preconditions.check(uses_import("ast"), Visitor())
|
|
172
173
|
|
|
173
174
|
|
|
174
175
|
@categorize(_Python38)
|
|
@@ -218,7 +219,7 @@ class ReplaceAstBytes(Recipe):
|
|
|
218
219
|
|
|
219
220
|
return field_access
|
|
220
221
|
|
|
221
|
-
return Visitor()
|
|
222
|
+
return Preconditions.check(uses_import("ast"), Visitor())
|
|
222
223
|
|
|
223
224
|
|
|
224
225
|
@categorize(_Python38)
|
|
@@ -268,7 +269,7 @@ class ReplaceAstNameConstant(Recipe):
|
|
|
268
269
|
|
|
269
270
|
return field_access
|
|
270
271
|
|
|
271
|
-
return Visitor()
|
|
272
|
+
return Preconditions.check(uses_import("ast"), Visitor())
|
|
272
273
|
|
|
273
274
|
|
|
274
275
|
@categorize(_Python38)
|
|
@@ -318,4 +319,4 @@ class ReplaceAstEllipsis(Recipe):
|
|
|
318
319
|
|
|
319
320
|
return field_access
|
|
320
321
|
|
|
321
|
-
return Visitor()
|
|
322
|
+
return Preconditions.check(uses_import("ast"), Visitor())
|
|
@@ -20,10 +20,11 @@ See: https://docs.python.org/3/library/asyncio-task.html
|
|
|
20
20
|
|
|
21
21
|
from typing import Any, List, Optional
|
|
22
22
|
|
|
23
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
23
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
24
24
|
from rewrite.category import CategoryDescriptor
|
|
25
25
|
from rewrite.decorators import categorize
|
|
26
26
|
from rewrite.marketplace import Python
|
|
27
|
+
from rewrite.python.preconditions import uses_import
|
|
27
28
|
from rewrite.markers import Markers
|
|
28
29
|
from rewrite.python.visitor import PythonVisitor
|
|
29
30
|
from rewrite.python.tree import Await, YieldFrom
|
|
@@ -222,4 +223,4 @@ class MigrateAsyncioCoroutine(Recipe):
|
|
|
222
223
|
|
|
223
224
|
return method
|
|
224
225
|
|
|
225
|
-
return Visitor()
|
|
226
|
+
return Preconditions.check(uses_import("asyncio"), Visitor())
|
|
@@ -18,10 +18,11 @@ See: https://docs.python.org/3/library/asyncio-task.html
|
|
|
18
18
|
|
|
19
19
|
from typing import Any, Optional
|
|
20
20
|
|
|
21
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
21
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
22
22
|
from rewrite.category import CategoryDescriptor
|
|
23
23
|
from rewrite.decorators import categorize
|
|
24
24
|
from rewrite.marketplace import Python
|
|
25
|
+
from rewrite.python.preconditions import uses_import
|
|
25
26
|
from rewrite.python.visitor import PythonVisitor
|
|
26
27
|
from rewrite.java.tree import Identifier, MethodInvocation, FieldAccess
|
|
27
28
|
from ._markers import mark_deprecated
|
|
@@ -103,4 +104,4 @@ class FindAsyncioCoroutineDecorator(Recipe):
|
|
|
103
104
|
|
|
104
105
|
return field_access
|
|
105
106
|
|
|
106
|
-
return Visitor()
|
|
107
|
+
return Preconditions.check(uses_import("asyncio"), Visitor())
|
|
@@ -13,10 +13,11 @@ See: https://docs.python.org/3/library/calendar.html
|
|
|
13
13
|
|
|
14
14
|
from typing import Any, Optional, Dict
|
|
15
15
|
|
|
16
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
16
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
17
17
|
from rewrite.category import CategoryDescriptor
|
|
18
18
|
from rewrite.decorators import categorize
|
|
19
19
|
from rewrite.marketplace import Python
|
|
20
|
+
from rewrite.python.preconditions import uses_import
|
|
20
21
|
from rewrite.python.visitor import PythonVisitor
|
|
21
22
|
from rewrite.java.tree import Identifier, FieldAccess
|
|
22
23
|
|
|
@@ -124,4 +125,4 @@ class ReplaceCalendarConstants(Recipe):
|
|
|
124
125
|
|
|
125
126
|
return field_access
|
|
126
127
|
|
|
127
|
-
return Visitor()
|
|
128
|
+
return Preconditions.check(uses_import("calendar"), Visitor())
|
|
@@ -16,7 +16,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
16
16
|
|
|
17
17
|
from typing import Any, List, Optional
|
|
18
18
|
|
|
19
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
19
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
20
|
+
from rewrite.python.preconditions import uses_import
|
|
20
21
|
from rewrite.category import CategoryDescriptor
|
|
21
22
|
from rewrite.decorators import categorize
|
|
22
23
|
from rewrite.marketplace import Python
|
|
@@ -123,7 +124,7 @@ class FindCgiModule(Recipe):
|
|
|
123
124
|
)
|
|
124
125
|
return import_stmt
|
|
125
126
|
|
|
126
|
-
return Visitor()
|
|
127
|
+
return Preconditions.check(uses_import("cgi"), Visitor())
|
|
127
128
|
|
|
128
129
|
|
|
129
130
|
@categorize(_Python313)
|
|
@@ -200,4 +201,4 @@ class FindCgitbModule(Recipe):
|
|
|
200
201
|
)
|
|
201
202
|
return import_stmt
|
|
202
203
|
|
|
203
|
-
return Visitor()
|
|
204
|
+
return Preconditions.check(uses_import("cgitb"), Visitor())
|
|
@@ -12,10 +12,11 @@ See: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow
|
|
|
12
12
|
|
|
13
13
|
from typing import Any, Optional
|
|
14
14
|
|
|
15
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
15
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
16
16
|
from rewrite.category import CategoryDescriptor
|
|
17
17
|
from rewrite.decorators import categorize
|
|
18
18
|
from rewrite.marketplace import Python
|
|
19
|
+
from rewrite.python.preconditions import uses_import
|
|
19
20
|
from rewrite.python.visitor import PythonVisitor
|
|
20
21
|
from rewrite.python.template import pattern, template, capture
|
|
21
22
|
from rewrite.java.tree import MethodInvocation
|
|
@@ -85,7 +86,7 @@ class ReplaceDatetimeUtcNow(Recipe):
|
|
|
85
86
|
return _utcnow_template.apply(self.cursor, values=match)
|
|
86
87
|
return method
|
|
87
88
|
|
|
88
|
-
return Visitor()
|
|
89
|
+
return Preconditions.check(uses_import("datetime"), Visitor())
|
|
89
90
|
|
|
90
91
|
|
|
91
92
|
@categorize(_Python312)
|
|
@@ -133,4 +134,4 @@ class ReplaceDatetimeUtcFromTimestamp(Recipe):
|
|
|
133
134
|
return _utcfromtimestamp_template.apply(self.cursor, values=match)
|
|
134
135
|
return method
|
|
135
136
|
|
|
136
|
-
return Visitor()
|
|
137
|
+
return Preconditions.check(uses_import("datetime"), Visitor())
|
|
@@ -15,7 +15,8 @@ See: https://peps.python.org/pep-0632/
|
|
|
15
15
|
|
|
16
16
|
from typing import Any, Optional
|
|
17
17
|
|
|
18
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
18
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
19
|
+
from rewrite.python.preconditions import uses_import
|
|
19
20
|
from rewrite.category import CategoryDescriptor
|
|
20
21
|
from rewrite.decorators import categorize
|
|
21
22
|
from rewrite.marketplace import Python
|
|
@@ -93,4 +94,4 @@ class FindDistutilsUsage(Recipe):
|
|
|
93
94
|
|
|
94
95
|
return multi
|
|
95
96
|
|
|
96
|
-
return Visitor()
|
|
97
|
+
return Preconditions.check(uses_import("distutils"), Visitor())
|
|
@@ -19,7 +19,8 @@ See: https://packaging.pypa.io/en/stable/version.html
|
|
|
19
19
|
|
|
20
20
|
from typing import Any, Optional
|
|
21
21
|
|
|
22
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
22
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
23
|
+
from rewrite.python.preconditions import uses_import
|
|
23
24
|
from rewrite.category import CategoryDescriptor
|
|
24
25
|
from rewrite.decorators import categorize
|
|
25
26
|
from rewrite.marketplace import Python
|
|
@@ -111,4 +112,4 @@ class ReplaceDistutilsVersion(Recipe):
|
|
|
111
112
|
|
|
112
113
|
return multi
|
|
113
114
|
|
|
114
|
-
return Visitor()
|
|
115
|
+
return Preconditions.check(uses_import("distutils"), Visitor())
|
|
@@ -14,10 +14,11 @@ See: https://docs.python.org/3/library/gettext.html
|
|
|
14
14
|
|
|
15
15
|
from typing import Any, Optional, Dict
|
|
16
16
|
|
|
17
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
17
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
18
18
|
from rewrite.category import CategoryDescriptor
|
|
19
19
|
from rewrite.decorators import categorize
|
|
20
20
|
from rewrite.marketplace import Python
|
|
21
|
+
from rewrite.python.preconditions import uses_import
|
|
21
22
|
from rewrite.python.visitor import PythonVisitor
|
|
22
23
|
from rewrite.java.tree import Identifier, MethodInvocation
|
|
23
24
|
|
|
@@ -122,4 +123,4 @@ class ReplaceGettextDeprecations(Recipe):
|
|
|
122
123
|
|
|
123
124
|
return method
|
|
124
125
|
|
|
125
|
-
return Visitor()
|
|
126
|
+
return Preconditions.check(uses_import("gettext"), Visitor())
|
|
@@ -17,7 +17,8 @@ See: https://peps.python.org/pep-3121/
|
|
|
17
17
|
|
|
18
18
|
from typing import Any, List, Optional
|
|
19
19
|
|
|
20
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
20
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
21
|
+
from rewrite.python.preconditions import uses_import
|
|
21
22
|
from rewrite.category import CategoryDescriptor
|
|
22
23
|
from rewrite.decorators import categorize
|
|
23
24
|
from rewrite.marketplace import Python
|
|
@@ -121,4 +122,4 @@ class FindImpUsage(Recipe):
|
|
|
121
122
|
)
|
|
122
123
|
return import_stmt
|
|
123
124
|
|
|
124
|
-
return Visitor()
|
|
125
|
+
return Preconditions.check(uses_import("imp"), Visitor())
|
|
@@ -9,11 +9,12 @@ See: https://docs.python.org/3/library/locale.html
|
|
|
9
9
|
|
|
10
10
|
from typing import Any, Optional
|
|
11
11
|
|
|
12
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
12
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
13
13
|
from rewrite.category import CategoryDescriptor
|
|
14
14
|
from rewrite.decorators import categorize
|
|
15
15
|
from rewrite.marketplace import Python
|
|
16
16
|
from rewrite.markers import Markers
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.python.visitor import PythonVisitor
|
|
18
19
|
from rewrite.java.tree import Identifier, MethodInvocation, Literal
|
|
19
20
|
from rewrite.java.support_types import JRightPadded, Space
|
|
@@ -159,4 +160,4 @@ class ReplaceLocaleResetlocale(Recipe):
|
|
|
159
160
|
|
|
160
161
|
return method
|
|
161
162
|
|
|
162
|
-
return Visitor()
|
|
163
|
+
return Preconditions.check(uses_import("locale"), Visitor())
|
|
@@ -8,7 +8,8 @@ See: https://docs.python.org/3/whatsnew/3.8.html#api-and-feature-removals
|
|
|
8
8
|
|
|
9
9
|
from typing import Any, List, Optional
|
|
10
10
|
|
|
11
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
11
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
12
|
+
from rewrite.python.preconditions import uses_import
|
|
12
13
|
from rewrite.category import CategoryDescriptor
|
|
13
14
|
from rewrite.decorators import categorize
|
|
14
15
|
from rewrite.marketplace import Python
|
|
@@ -112,4 +113,4 @@ class FindMacpathModule(Recipe):
|
|
|
112
113
|
)
|
|
113
114
|
return import_stmt
|
|
114
115
|
|
|
115
|
-
return Visitor()
|
|
116
|
+
return Preconditions.check(uses_import("macpath"), Visitor())
|
|
@@ -13,7 +13,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
13
13
|
|
|
14
14
|
from typing import Any, List, Optional
|
|
15
15
|
|
|
16
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
16
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.category import CategoryDescriptor
|
|
18
19
|
from rewrite.decorators import categorize
|
|
19
20
|
from rewrite.marketplace import Python
|
|
@@ -116,4 +117,4 @@ class FindMailcapModule(Recipe):
|
|
|
116
117
|
)
|
|
117
118
|
return import_stmt
|
|
118
119
|
|
|
119
|
-
return Visitor()
|
|
120
|
+
return Preconditions.check(uses_import("mailcap"), Visitor())
|
|
@@ -12,7 +12,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
12
12
|
|
|
13
13
|
from typing import Any, List, Optional
|
|
14
14
|
|
|
15
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
15
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
16
|
+
from rewrite.python.preconditions import uses_import
|
|
16
17
|
from rewrite.category import CategoryDescriptor
|
|
17
18
|
from rewrite.decorators import categorize
|
|
18
19
|
from rewrite.marketplace import Python
|
|
@@ -114,4 +115,4 @@ class FindNntplibModule(Recipe):
|
|
|
114
115
|
)
|
|
115
116
|
return import_stmt
|
|
116
117
|
|
|
117
|
-
return Visitor()
|
|
118
|
+
return Preconditions.check(uses_import("nntplib"), Visitor())
|
|
@@ -14,7 +14,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
14
14
|
|
|
15
15
|
from typing import Any, List, Optional
|
|
16
16
|
|
|
17
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
17
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
18
|
+
from rewrite.python.preconditions import uses_import
|
|
18
19
|
from rewrite.category import CategoryDescriptor
|
|
19
20
|
from rewrite.decorators import categorize
|
|
20
21
|
from rewrite.marketplace import Python
|
|
@@ -118,7 +119,7 @@ class FindCryptModule(Recipe):
|
|
|
118
119
|
)
|
|
119
120
|
return import_stmt
|
|
120
121
|
|
|
121
|
-
return Visitor()
|
|
122
|
+
return Preconditions.check(uses_import("crypt"), Visitor())
|
|
122
123
|
|
|
123
124
|
|
|
124
125
|
@categorize(_Python313)
|
|
@@ -192,7 +193,7 @@ class FindMsilibModule(Recipe):
|
|
|
192
193
|
)
|
|
193
194
|
return import_stmt
|
|
194
195
|
|
|
195
|
-
return Visitor()
|
|
196
|
+
return Preconditions.check(uses_import("msilib"), Visitor())
|
|
196
197
|
|
|
197
198
|
|
|
198
199
|
@categorize(_Python313)
|
|
@@ -267,7 +268,7 @@ class FindNisModule(Recipe):
|
|
|
267
268
|
)
|
|
268
269
|
return import_stmt
|
|
269
270
|
|
|
270
|
-
return Visitor()
|
|
271
|
+
return Preconditions.check(uses_import("nis"), Visitor())
|
|
271
272
|
|
|
272
273
|
|
|
273
274
|
@categorize(_Python313)
|
|
@@ -342,7 +343,7 @@ class FindOssaudiodevModule(Recipe):
|
|
|
342
343
|
)
|
|
343
344
|
return import_stmt
|
|
344
345
|
|
|
345
|
-
return Visitor()
|
|
346
|
+
return Preconditions.check(uses_import("ossaudiodev"), Visitor())
|
|
346
347
|
|
|
347
348
|
|
|
348
349
|
@categorize(_Python313)
|
|
@@ -416,4 +417,4 @@ class FindSpwdModule(Recipe):
|
|
|
416
417
|
)
|
|
417
418
|
return import_stmt
|
|
418
419
|
|
|
419
|
-
return Visitor()
|
|
420
|
+
return Preconditions.check(uses_import("spwd"), Visitor())
|
|
@@ -13,7 +13,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
13
13
|
|
|
14
14
|
from typing import Any, List, Optional
|
|
15
15
|
|
|
16
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
16
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.category import CategoryDescriptor
|
|
18
19
|
from rewrite.decorators import categorize
|
|
19
20
|
from rewrite.marketplace import Python
|
|
@@ -117,4 +118,4 @@ class FindPipesModule(Recipe):
|
|
|
117
118
|
)
|
|
118
119
|
return import_stmt
|
|
119
120
|
|
|
120
|
-
return Visitor()
|
|
121
|
+
return Preconditions.check(uses_import("pipes"), Visitor())
|
|
@@ -11,10 +11,11 @@ See: https://docs.python.org/3/library/pkgutil.html
|
|
|
11
11
|
|
|
12
12
|
from typing import Any, Optional, cast
|
|
13
13
|
|
|
14
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
14
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
15
15
|
from rewrite.category import CategoryDescriptor
|
|
16
16
|
from rewrite.decorators import categorize
|
|
17
17
|
from rewrite.marketplace import Python
|
|
18
|
+
from rewrite.python.preconditions import uses_import
|
|
18
19
|
from rewrite.python.visitor import PythonVisitor
|
|
19
20
|
from rewrite.python.template import pattern, template, capture
|
|
20
21
|
from rewrite.python.add_import import AddImportOptions, maybe_add_import
|
|
@@ -87,7 +88,7 @@ class ReplacePkgutilFindLoader(Recipe):
|
|
|
87
88
|
return _find_spec_template.apply(self.cursor, values=match)
|
|
88
89
|
return m
|
|
89
90
|
|
|
90
|
-
return Visitor()
|
|
91
|
+
return Preconditions.check(uses_import("pkgutil"), Visitor())
|
|
91
92
|
|
|
92
93
|
|
|
93
94
|
@categorize(_Python312)
|
|
@@ -139,4 +140,4 @@ class ReplacePkgutilGetLoader(Recipe):
|
|
|
139
140
|
return _find_spec_template.apply(self.cursor, values=match)
|
|
140
141
|
return m
|
|
141
142
|
|
|
142
|
-
return Visitor()
|
|
143
|
+
return Preconditions.check(uses_import("pkgutil"), Visitor())
|
|
@@ -15,7 +15,8 @@ See: https://docs.python.org/3/whatsnew/3.12.html#removed
|
|
|
15
15
|
|
|
16
16
|
from typing import Any, Optional
|
|
17
17
|
|
|
18
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
18
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
19
|
+
from rewrite.python.preconditions import uses_import
|
|
19
20
|
from rewrite.category import CategoryDescriptor
|
|
20
21
|
from rewrite.decorators import categorize
|
|
21
22
|
from rewrite.marketplace import Python
|
|
@@ -136,4 +137,9 @@ class FindRemovedModules312(Recipe):
|
|
|
136
137
|
return _mark_removed(import_stmt, name)
|
|
137
138
|
return import_stmt
|
|
138
139
|
|
|
139
|
-
return
|
|
140
|
+
return Preconditions.check(
|
|
141
|
+
Preconditions.or_(
|
|
142
|
+
*(uses_import(m) for m in REMOVED_MODULES_312)
|
|
143
|
+
),
|
|
144
|
+
Visitor(),
|
|
145
|
+
)
|
|
@@ -10,10 +10,11 @@ See: https://docs.python.org/3/library/ssl.html
|
|
|
10
10
|
|
|
11
11
|
from typing import Any, Optional
|
|
12
12
|
|
|
13
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
13
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
14
14
|
from rewrite.category import CategoryDescriptor
|
|
15
15
|
from rewrite.decorators import categorize
|
|
16
16
|
from rewrite.marketplace import Python
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.python.visitor import PythonVisitor
|
|
18
19
|
from rewrite.java.tree import Identifier, MethodInvocation
|
|
19
20
|
from ._markers import mark_deprecated
|
|
@@ -98,4 +99,4 @@ class FindSslMatchHostname(Recipe):
|
|
|
98
99
|
|
|
99
100
|
return method
|
|
100
101
|
|
|
101
|
-
return Visitor()
|
|
102
|
+
return Preconditions.check(uses_import("ssl"), Visitor())
|
|
@@ -10,10 +10,11 @@ See: https://docs.python.org/3/whatsnew/3.8.html#api-and-feature-removals
|
|
|
10
10
|
|
|
11
11
|
from typing import Any, List, Optional
|
|
12
12
|
|
|
13
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
13
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
14
14
|
from rewrite.category import CategoryDescriptor
|
|
15
15
|
from rewrite.decorators import categorize
|
|
16
16
|
from rewrite.marketplace import Python
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.python.visitor import PythonVisitor
|
|
18
19
|
from rewrite.java.tree import Identifier, MethodInvocation
|
|
19
20
|
from ._markers import mark_deprecated
|
|
@@ -84,4 +85,4 @@ class FindSysCoroutineWrapper(Recipe):
|
|
|
84
85
|
f"sys.{method.name.simple_name}() was removed in Python 3.8."
|
|
85
86
|
)
|
|
86
87
|
|
|
87
|
-
return Visitor()
|
|
88
|
+
return Preconditions.check(uses_import("sys"), Visitor())
|
|
@@ -14,10 +14,11 @@ See: https://docs.python.org/3/whatsnew/3.12.html#deprecated
|
|
|
14
14
|
|
|
15
15
|
from typing import Any, List, Optional, cast
|
|
16
16
|
|
|
17
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
17
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
18
18
|
from rewrite.category import CategoryDescriptor
|
|
19
19
|
from rewrite.decorators import categorize
|
|
20
20
|
from rewrite.marketplace import Python
|
|
21
|
+
from rewrite.python.preconditions import uses_import
|
|
21
22
|
from rewrite.python.visitor import PythonVisitor
|
|
22
23
|
from rewrite.python.template import pattern, template
|
|
23
24
|
from rewrite.java.tree import FieldAccess, J
|
|
@@ -96,4 +97,4 @@ class ReplaceSysLastExcInfo(Recipe):
|
|
|
96
97
|
return _last_exc_traceback_template.apply(self.cursor)
|
|
97
98
|
return fa
|
|
98
99
|
|
|
99
|
-
return Visitor()
|
|
100
|
+
return Preconditions.check(uses_import("sys"), Visitor())
|
|
@@ -14,7 +14,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
14
14
|
|
|
15
15
|
from typing import Any, List, Optional
|
|
16
16
|
|
|
17
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
17
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
18
|
+
from rewrite.python.preconditions import uses_import
|
|
18
19
|
from rewrite.category import CategoryDescriptor
|
|
19
20
|
from rewrite.decorators import categorize
|
|
20
21
|
from rewrite.marketplace import Python
|
|
@@ -119,4 +120,4 @@ class FindTelnetlibModule(Recipe):
|
|
|
119
120
|
)
|
|
120
121
|
return import_stmt
|
|
121
122
|
|
|
122
|
-
return Visitor()
|
|
123
|
+
return Preconditions.check(uses_import("telnetlib"), Visitor())
|
|
@@ -13,7 +13,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
13
13
|
|
|
14
14
|
from typing import Any, List, Optional
|
|
15
15
|
|
|
16
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
16
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.category import CategoryDescriptor
|
|
18
19
|
from rewrite.decorators import categorize
|
|
19
20
|
from rewrite.marketplace import Python
|
|
@@ -116,4 +117,4 @@ class FindUuModule(Recipe):
|
|
|
116
117
|
)
|
|
117
118
|
return import_stmt
|
|
118
119
|
|
|
119
|
-
return Visitor()
|
|
120
|
+
return Preconditions.check(uses_import("uu"), Visitor())
|
|
@@ -13,7 +13,8 @@ See: https://peps.python.org/pep-0594/
|
|
|
13
13
|
|
|
14
14
|
from typing import Any, List, Optional
|
|
15
15
|
|
|
16
|
-
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
16
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
17
|
+
from rewrite.python.preconditions import uses_import
|
|
17
18
|
from rewrite.category import CategoryDescriptor
|
|
18
19
|
from rewrite.decorators import categorize
|
|
19
20
|
from rewrite.marketplace import Python
|
|
@@ -116,4 +117,4 @@ class FindXdrlibModule(Recipe):
|
|
|
116
117
|
)
|
|
117
118
|
return import_stmt
|
|
118
119
|
|
|
119
|
-
return Visitor()
|
|
120
|
+
return Preconditions.check(uses_import("xdrlib"), Visitor())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openrewrite-migrate-python
|
|
3
|
-
Version: 0.10.0.
|
|
3
|
+
Version: 0.10.0.dev20260620181905
|
|
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
|
|
@@ -12,8 +12,8 @@ class TestFindSysCoroutineWrapper:
|
|
|
12
12
|
spec = RecipeSpec(recipe=FindSysCoroutineWrapper())
|
|
13
13
|
spec.rewrite_run(
|
|
14
14
|
python(
|
|
15
|
-
"sys.set_coroutine_wrapper(wrapper)",
|
|
16
|
-
"/*~~(sys.set_coroutine_wrapper() was removed in Python 3.8.)~~>*/sys.set_coroutine_wrapper(wrapper)",
|
|
15
|
+
"import sys\nsys.set_coroutine_wrapper(wrapper)",
|
|
16
|
+
"import sys\n/*~~(sys.set_coroutine_wrapper() was removed in Python 3.8.)~~>*/sys.set_coroutine_wrapper(wrapper)",
|
|
17
17
|
)
|
|
18
18
|
)
|
|
19
19
|
|
|
@@ -21,8 +21,8 @@ class TestFindSysCoroutineWrapper:
|
|
|
21
21
|
spec = RecipeSpec(recipe=FindSysCoroutineWrapper())
|
|
22
22
|
spec.rewrite_run(
|
|
23
23
|
python(
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"import sys\nold = sys.get_coroutine_wrapper()",
|
|
25
|
+
"import sys\nold = /*~~(sys.get_coroutine_wrapper() was removed in Python 3.8.)~~>*/sys.get_coroutine_wrapper()",
|
|
26
26
|
)
|
|
27
27
|
)
|
|
28
28
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|