openrewrite-migrate-python 0.17.0.dev20261022193254__tar.gz → 0.17.0.dev20261022194832__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.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/PKG-INFO +1 -1
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/pyproject.toml +1 -1
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/__init__.py +19 -3
- openrewrite_migrate_python-0.17.0.dev20261022194832/src/openrewrite_migrate_python/migrate/array_deprecations.py +201 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/asyncio_deprecations.py +115 -1
- openrewrite_migrate_python-0.17.0.dev20261022194832/src/openrewrite_migrate_python/migrate/builtins_deprecations.py +89 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/collections_abc_migrations.py +66 -2
- openrewrite_migrate_python-0.17.0.dev20261022194832/src/openrewrite_migrate_python/migrate/profile_deprecations.py +68 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python312.py +5 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python313.py +3 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python314.py +4 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python315.py +6 -1
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python39.py +2 -2
- openrewrite_migrate_python-0.17.0.dev20261022194832/src/openrewrite_migrate_python/migrate/webbrowser_deprecations.py +63 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python.egg-info/PKG-INFO +1 -1
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python.egg-info/SOURCES.txt +6 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_array_deprecations.py +33 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_asyncio_deprecations.py +88 -0
- openrewrite_migrate_python-0.17.0.dev20261022194832/tests/test_builtins_deprecations.py +47 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_collections_abc_migrations.py +43 -0
- openrewrite_migrate_python-0.17.0.dev20261022194832/tests/test_profile_deprecations.py +23 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_upgrade_recipes.py +13 -0
- openrewrite_migrate_python-0.17.0.dev20261022194832/tests/test_webbrowser_deprecations.py +22 -0
- openrewrite_migrate_python-0.17.0.dev20261022193254/src/openrewrite_migrate_python/migrate/array_deprecations.py +0 -113
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/setup.cfg +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/__init__.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/__init__.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/_literals.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/_negation.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/assign_return.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/attr_access.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/boolean_simplification.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/collection_literals.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/comparison_simplification.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/complex_transforms.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/comprehension_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/conditionals.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/datetime_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/dict_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/exception_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/expression_simplification.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/logger_warn.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/loop_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/merge_nested_with.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/merge_startswith_endswith.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/naming_conventions.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/negated_operators.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/none_and_identity.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/object_inheritance.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/pandas_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/python_best_practices.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/range_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/redundant_code.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/remove_trailing_return_none.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/string_cleanup.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/unreachable_code.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/use_items.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/use_list_clear.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/cleanup/yoda_conditions.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/__init__.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/_reindent.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/_semantically_equal.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/_side_effects.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/_trivia.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/_truth_value.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/all_branches_identical.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/boolean_checks_not_inverted.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/code_quality.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/collapsible_if_statements.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/find_suspicious_chained_comparison.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/merge_identical_branches.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/remove_duplicate_conditions.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/remove_self_assignment.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/remove_unconditional_value_overwrite.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/simplify_boolean_literal.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_code_quality_python/codequality/simplify_redundant_logical_expression.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/__init__.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/_decorators.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/_finders.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/_langchain_tables.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/_markers.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/_method_renames.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/_module_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/_slots.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/aifc_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/ast_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/asyncio_coroutine_to_async.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/avro_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/backoff_to_tenacity.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/calendar_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/cgi_escape_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/cgi_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/cgi_parse_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/configparser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/ctypes_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/datetime_utc.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/distutils_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/distutils_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/functools_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/future_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/gettext_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/glob_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/html_parser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/http_server_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/imp_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/importlib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/importlib_resources_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/inspect_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/langchain_classic_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/langchain_community_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/langchain_provider_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/locale_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/locale_getdefaultlocale_deprecation.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/macpath_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/mailcap_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/module_cached_attribute.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/nntplib_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/os_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/pathlib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/pep594_system_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/pipes_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/pkgutil_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/platform_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/pydantic_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/pydantic_fields.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/pydantic_model_fields.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/re_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/removed_modules_312.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/shutil_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/socket_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/sre_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/ssl_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/string_formatting.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/sys_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/sys_last_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/tarfile_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/telnetlib_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/tempfile_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/text_encoding.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/threading_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/threading_is_alive_deprecation.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/types_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/typing_callable.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/typing_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/typing_functional_syntax.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/typing_union_to_pipe.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/unittest_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_langchain02.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_langchain1.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_pandas.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_pydantic.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python310.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python311.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/upgrade_to_python38.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/urllib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/uu_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/wave_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/xdrlib_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python/migrate/xml_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python.egg-info/dependency_links.txt +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python.egg-info/entry_points.txt +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python.egg-info/requires.txt +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/src/openrewrite_migrate_python.egg-info/top_level.txt +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_aifc_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_ast_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_asyncio_coroutine_to_async.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_avro_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_backoff_to_tenacity.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_calendar_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_cgi_escape_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_cgi_parse_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_change_import_recipes.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_configparser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_ctypes_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_datetime_utc.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_distutils_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_distutils_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_functools_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_future_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_gettext_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_glob_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_html_parser_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_http_server_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_imp_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_importlib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_importlib_resources_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_inspect_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_langchain_classic_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_langchain_community_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_langchain_provider_imports.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_locale_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_locale_getdefaultlocale_deprecation.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_macpath_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_mailcap_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_markers.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_module_cached_attribute.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_os_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_pathlib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_pep594_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_pep594_system_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_pkgutil_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_platform_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_pydantic_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_pydantic_fields.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_pydantic_model_fields.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_re_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_removed_modules_312.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_shutil_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_socket_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_sre_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_ssl_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_string_formatting.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_sys_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_sys_last_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_tarfile_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_tempfile_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_text_encoding.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_threading_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_threading_extended.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_threading_is_alive_deprecation.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_types_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_typing_alias_moves.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_typing_callable.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_typing_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_typing_functional_syntax.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_typing_union_to_pipe.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_unittest_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_upgrade_to_pydantic.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_urllib_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_wave_deprecations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/tests/test_xdrlib_migrations.py +0 -0
- {openrewrite_migrate_python-0.17.0.dev20261022193254 → openrewrite_migrate_python-0.17.0.dev20261022194832}/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.17.0.
|
|
3
|
+
Version: 0.17.0.dev20261022194832
|
|
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.17.0.
|
|
8
|
+
version = "0.17.0.dev20261022194832" # 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"
|
|
@@ -20,7 +20,7 @@ from .aifc_migrations import (
|
|
|
20
20
|
FindSndhdrModule,
|
|
21
21
|
FindSunauModule,
|
|
22
22
|
)
|
|
23
|
-
from .array_deprecations import ReplaceArrayFromstring, ReplaceArrayTostring
|
|
23
|
+
from .array_deprecations import FindArrayUnicodeTypecode, ReplaceArrayFromstring, ReplaceArrayTostring
|
|
24
24
|
from .ast_deprecations import (
|
|
25
25
|
ReplaceAstBytes,
|
|
26
26
|
ReplaceAstEllipsis,
|
|
@@ -29,17 +29,22 @@ from .ast_deprecations import (
|
|
|
29
29
|
ReplaceAstStr,
|
|
30
30
|
)
|
|
31
31
|
from .asyncio_coroutine_to_async import MigrateAsyncioCoroutine
|
|
32
|
-
from .asyncio_deprecations import
|
|
32
|
+
from .asyncio_deprecations import (
|
|
33
|
+
FindAsyncioCoroutineDecorator,
|
|
34
|
+
FindAsyncioEventLoopPolicy,
|
|
35
|
+
ReplaceAsyncioIscoroutinefunction,
|
|
36
|
+
)
|
|
33
37
|
from .avro_migrations import MigrateAvroPython3ToAvro
|
|
34
38
|
from .backoff_to_tenacity import (
|
|
35
39
|
FindBackoffDecoratorsNotMigrated,
|
|
36
40
|
MigrateBackoffToTenacity,
|
|
37
41
|
ReplaceBackoffDecoratorsWithTenacity,
|
|
38
42
|
)
|
|
43
|
+
from .builtins_deprecations import FindBitwiseInversionOnBool
|
|
39
44
|
from .calendar_deprecations import ReplaceCalendarConstants
|
|
40
45
|
from .cgi_migrations import FindCgiModule, FindCgitbModule
|
|
41
46
|
from .cgi_parse_deprecations import ReplaceCgiParseQs, ReplaceCgiParseQsl
|
|
42
|
-
from .collections_abc_migrations import ReplaceCollectionsAbcImports
|
|
47
|
+
from .collections_abc_migrations import FindByteString, ReplaceCollectionsAbcImports
|
|
43
48
|
from .configparser_deprecations import (
|
|
44
49
|
ReplaceConfigparserReadfp,
|
|
45
50
|
ReplaceConfigparserSafeConfigParser,
|
|
@@ -76,6 +81,7 @@ from .pep594_system_migrations import (
|
|
|
76
81
|
)
|
|
77
82
|
from .pipes_migrations import FindPipesModule
|
|
78
83
|
from .pkgutil_deprecations import ReplacePkgutilFindLoader, ReplacePkgutilGetLoader
|
|
84
|
+
from .profile_deprecations import FindProfileModule
|
|
79
85
|
from .pydantic_deprecations import (
|
|
80
86
|
FindDeprecatedJsonEncoders,
|
|
81
87
|
FindDeprecatedSchemaGenerator,
|
|
@@ -148,6 +154,7 @@ from .upgrade_to_pydantic import (
|
|
|
148
154
|
from .urllib_deprecations import FindUrllibParseSplitFunctions, FindUrllibParseToBytes
|
|
149
155
|
from .uu_migrations import FindUuModule
|
|
150
156
|
from .wave_deprecations import FindWaveMarkers
|
|
157
|
+
from .webbrowser_deprecations import FindWebbrowserMacOSXOSAScript
|
|
151
158
|
from .xdrlib_migrations import FindXdrlibModule
|
|
152
159
|
from .xml_deprecations import ReplaceElementGetchildren, ReplaceElementGetiterator
|
|
153
160
|
|
|
@@ -279,6 +286,15 @@ __all__ = [
|
|
|
279
286
|
"FindSreModules",
|
|
280
287
|
"FindTypingNoTypeCheckDecorator",
|
|
281
288
|
"FindWaveMarkers",
|
|
289
|
+
# Auto-fix: Python 3.16 and 3.17 removals
|
|
290
|
+
"ReplaceAsyncioIscoroutinefunction",
|
|
291
|
+
# Detection: Python 3.16 and 3.17 removals
|
|
292
|
+
"FindArrayUnicodeTypecode",
|
|
293
|
+
"FindAsyncioEventLoopPolicy",
|
|
294
|
+
"FindBitwiseInversionOnBool",
|
|
295
|
+
"FindByteString",
|
|
296
|
+
"FindProfileModule",
|
|
297
|
+
"FindWebbrowserMacOSXOSAScript",
|
|
282
298
|
# Auto-fix: LangChain
|
|
283
299
|
"ReplaceLangchainCommunityImports",
|
|
284
300
|
"ReplaceLangchainProviderImports",
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Recipes for migrating deprecated array module methods.
|
|
3
|
+
|
|
4
|
+
The following methods were deprecated in Python 3.2 and removed in Python 3.9:
|
|
5
|
+
- ``array.tostring()`` -> ``array.tobytes()``
|
|
6
|
+
- ``array.fromstring()`` -> ``array.frombytes()``
|
|
7
|
+
|
|
8
|
+
The ``'u'`` typecode was deprecated in Python 3.13 and is scheduled for
|
|
9
|
+
removal in Python 3.16; ``FindArrayUnicodeTypecode`` reports it.
|
|
10
|
+
|
|
11
|
+
See: https://docs.python.org/3/library/array.html
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from typing import Any, List, Optional
|
|
15
|
+
|
|
16
|
+
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
17
|
+
from rewrite.category import CategoryDescriptor
|
|
18
|
+
from rewrite.decorators import categorize
|
|
19
|
+
from rewrite.java.tree import Empty, Identifier, J, Literal, MethodInvocation
|
|
20
|
+
from rewrite.marketplace import Python
|
|
21
|
+
from rewrite.python.method_matcher import MethodMatcher
|
|
22
|
+
from rewrite.python.preconditions import uses_method
|
|
23
|
+
from rewrite.python.tree import NamedArgument
|
|
24
|
+
from rewrite.python.visitor import PythonVisitor
|
|
25
|
+
|
|
26
|
+
from ._markers import mark_deprecated
|
|
27
|
+
from ._method_renames import rename_methods
|
|
28
|
+
|
|
29
|
+
# Define category path: Python > Migrate > Python 3.9
|
|
30
|
+
_Python39 = [
|
|
31
|
+
*Python,
|
|
32
|
+
CategoryDescriptor(display_name="Migrate"),
|
|
33
|
+
CategoryDescriptor(display_name="Python 3.9"),
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
# Define category path: Python > Migrate > Python 3.13
|
|
37
|
+
_Python313 = [
|
|
38
|
+
*Python,
|
|
39
|
+
CategoryDescriptor(display_name="Migrate"),
|
|
40
|
+
CategoryDescriptor(display_name="Python 3.13"),
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@categorize(_Python39)
|
|
45
|
+
class ReplaceArrayTostring(Recipe):
|
|
46
|
+
"""
|
|
47
|
+
Replace ``array.tostring()`` with ``array.tobytes()``.
|
|
48
|
+
|
|
49
|
+
The ``tostring()`` method was deprecated in Python 3.2 and removed in
|
|
50
|
+
Python 3.9. ``tobytes()`` behaves identically.
|
|
51
|
+
|
|
52
|
+
Example:
|
|
53
|
+
Before:
|
|
54
|
+
import array
|
|
55
|
+
my_array = array.array("b", b"ab")
|
|
56
|
+
data = my_array.tostring()
|
|
57
|
+
|
|
58
|
+
After:
|
|
59
|
+
import array
|
|
60
|
+
my_array = array.array("b", b"ab")
|
|
61
|
+
data = my_array.tobytes()
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def name(self) -> str:
|
|
66
|
+
return "org.openrewrite.python.migrate.ReplaceArrayTostring"
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def display_name(self) -> str:
|
|
70
|
+
return "Replace `array.tostring()` with `array.tobytes()`"
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def description(self) -> str:
|
|
74
|
+
return (
|
|
75
|
+
"Replace `tostring()` with `tobytes()` on array objects. "
|
|
76
|
+
"The `tostring()` method was deprecated in Python 3.2 and removed in 3.9. "
|
|
77
|
+
"Only fires where the receiver's type resolves to `array.array` or a subclass."
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def tags(self) -> List[str]:
|
|
82
|
+
return ["python", "migration", "3.9", "array"]
|
|
83
|
+
|
|
84
|
+
def editor(self) -> TreeVisitor[Any, ExecutionContext]:
|
|
85
|
+
return rename_methods("array.array", {"tostring": "tobytes"})
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@categorize(_Python39)
|
|
89
|
+
class ReplaceArrayFromstring(Recipe):
|
|
90
|
+
"""
|
|
91
|
+
Replace ``array.fromstring()`` with ``array.frombytes()``.
|
|
92
|
+
|
|
93
|
+
The ``fromstring()`` method was deprecated in Python 3.2 and removed in
|
|
94
|
+
Python 3.9. ``frombytes()`` behaves identically.
|
|
95
|
+
|
|
96
|
+
Example:
|
|
97
|
+
Before:
|
|
98
|
+
import array
|
|
99
|
+
my_array = array.array("b")
|
|
100
|
+
my_array.fromstring(data)
|
|
101
|
+
|
|
102
|
+
After:
|
|
103
|
+
import array
|
|
104
|
+
my_array = array.array("b")
|
|
105
|
+
my_array.frombytes(data)
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def name(self) -> str:
|
|
110
|
+
return "org.openrewrite.python.migrate.ReplaceArrayFromstring"
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def display_name(self) -> str:
|
|
114
|
+
return "Replace `array.fromstring()` with `array.frombytes()`"
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def description(self) -> str:
|
|
118
|
+
return (
|
|
119
|
+
"Replace `fromstring()` with `frombytes()` on array objects. "
|
|
120
|
+
"The `fromstring()` method was deprecated in Python 3.2 and removed in 3.9. "
|
|
121
|
+
"Only fires where the receiver's type resolves to `array.array` or a subclass."
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def tags(self) -> List[str]:
|
|
126
|
+
return ["python", "migration", "3.9", "array"]
|
|
127
|
+
|
|
128
|
+
def editor(self) -> TreeVisitor[Any, ExecutionContext]:
|
|
129
|
+
return rename_methods("array.array", {"fromstring": "frombytes"})
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
_ARRAY = "array.array <constructor>(..)"
|
|
133
|
+
_ARRAY_MATCHER = MethodMatcher.create(_ARRAY)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def _typecode(call: MethodInvocation) -> Optional[J]:
|
|
137
|
+
for arg in call.arguments:
|
|
138
|
+
if isinstance(arg, NamedArgument):
|
|
139
|
+
if isinstance(arg.name, Identifier) and arg.name.simple_name == "typecode":
|
|
140
|
+
return arg.value
|
|
141
|
+
elif not isinstance(arg, Empty):
|
|
142
|
+
return arg
|
|
143
|
+
return None
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@categorize(_Python313)
|
|
147
|
+
class FindArrayUnicodeTypecode(Recipe):
|
|
148
|
+
"""
|
|
149
|
+
Find arrays created with the `'u'` typecode, deprecated in Python 3.13
|
|
150
|
+
and scheduled for removal in Python 3.16.
|
|
151
|
+
|
|
152
|
+
`'u'` stores `wchar_t`, two bytes on Windows and four elsewhere. `'w'`
|
|
153
|
+
stores `Py_UCS4`, four bytes everywhere, so code reading the array's raw
|
|
154
|
+
bytes on Windows needs adjusting too.
|
|
155
|
+
|
|
156
|
+
Example:
|
|
157
|
+
Before:
|
|
158
|
+
import array
|
|
159
|
+
chars = array.array("u", "hello")
|
|
160
|
+
|
|
161
|
+
After:
|
|
162
|
+
import array
|
|
163
|
+
chars = array.array("w", "hello")
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def name(self) -> str:
|
|
168
|
+
return "org.openrewrite.python.migrate.FindArrayUnicodeTypecode"
|
|
169
|
+
|
|
170
|
+
@property
|
|
171
|
+
def display_name(self) -> str:
|
|
172
|
+
return "Find `array` `'u'` typecode"
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def description(self) -> str:
|
|
176
|
+
return (
|
|
177
|
+
"The `'u'` typecode of `array.array` was deprecated in Python 3.13 and is scheduled for "
|
|
178
|
+
"removal in Python 3.16. Use `'w'`, which stores 4-byte `Py_UCS4` code points where `'u'` "
|
|
179
|
+
"stored the platform's `wchar_t`, 2 bytes on Windows."
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
@property
|
|
183
|
+
def tags(self) -> List[str]:
|
|
184
|
+
return ["python", "migration", "3.13", "3.16", "array"]
|
|
185
|
+
|
|
186
|
+
def editor(self) -> TreeVisitor[Any, ExecutionContext]:
|
|
187
|
+
class Visitor(PythonVisitor[ExecutionContext]):
|
|
188
|
+
def visit_method_invocation(self, method: MethodInvocation, p: ExecutionContext) -> J:
|
|
189
|
+
m = super().visit_method_invocation(method, p)
|
|
190
|
+
if not isinstance(m, MethodInvocation) or not _ARRAY_MATCHER.matches(m, cursor=self.cursor):
|
|
191
|
+
return m
|
|
192
|
+
typecode = _typecode(m)
|
|
193
|
+
if isinstance(typecode, Literal) and typecode.value == "u":
|
|
194
|
+
return mark_deprecated(
|
|
195
|
+
m,
|
|
196
|
+
"The 'u' array typecode is deprecated and removed in Python 3.16. "
|
|
197
|
+
"Use 'w' (4-byte Py_UCS4) instead.",
|
|
198
|
+
)
|
|
199
|
+
return m
|
|
200
|
+
|
|
201
|
+
return Preconditions.check(uses_method(_ARRAY), Visitor())
|
|
@@ -13,10 +13,14 @@ becomes:
|
|
|
13
13
|
async def my_func():
|
|
14
14
|
await something()
|
|
15
15
|
|
|
16
|
+
``asyncio.iscoroutinefunction()`` and the event loop policy system were
|
|
17
|
+
deprecated in Python 3.14 and are scheduled for removal in Python 3.16.
|
|
18
|
+
|
|
16
19
|
See: https://docs.python.org/3/library/asyncio-task.html
|
|
20
|
+
See: https://docs.python.org/3/deprecations/pending-removal-in-3.16.html
|
|
17
21
|
"""
|
|
18
22
|
|
|
19
|
-
from typing import Any
|
|
23
|
+
from typing import Any, List
|
|
20
24
|
|
|
21
25
|
from rewrite import ExecutionContext, Preconditions, Recipe, TreeVisitor
|
|
22
26
|
from rewrite.category import CategoryDescriptor
|
|
@@ -24,8 +28,10 @@ from rewrite.decorators import categorize
|
|
|
24
28
|
from rewrite.marketplace import Python
|
|
25
29
|
from rewrite.python.binding_utils import import_bindings
|
|
26
30
|
from rewrite.python.preconditions import uses_import
|
|
31
|
+
from rewrite.python.recipes import ChangeImport
|
|
27
32
|
from rewrite.python.visitor import PythonVisitor
|
|
28
33
|
from rewrite.java.tree import FieldAccess, Identifier, J
|
|
34
|
+
from ._finders import find_member_references
|
|
29
35
|
from ._markers import mark_deprecated
|
|
30
36
|
|
|
31
37
|
# Define category path: Python > Migrate > Python 3.11
|
|
@@ -35,6 +41,13 @@ _Python311 = [
|
|
|
35
41
|
CategoryDescriptor(display_name="Python 3.11"),
|
|
36
42
|
]
|
|
37
43
|
|
|
44
|
+
# Define category path: Python > Migrate > Python 3.14
|
|
45
|
+
_Python314 = [
|
|
46
|
+
*Python,
|
|
47
|
+
CategoryDescriptor(display_name="Migrate"),
|
|
48
|
+
CategoryDescriptor(display_name="Python 3.14"),
|
|
49
|
+
]
|
|
50
|
+
|
|
38
51
|
|
|
39
52
|
def _mark(tree: J) -> J:
|
|
40
53
|
return mark_deprecated(
|
|
@@ -106,3 +119,104 @@ class FindAsyncioCoroutineDecorator(Recipe):
|
|
|
106
119
|
return _mark(i)
|
|
107
120
|
|
|
108
121
|
return Preconditions.check(uses_import("asyncio"), Visitor())
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@categorize(_Python314)
|
|
125
|
+
class ReplaceAsyncioIscoroutinefunction(Recipe):
|
|
126
|
+
"""
|
|
127
|
+
Replace `asyncio.iscoroutinefunction()` with
|
|
128
|
+
`inspect.iscoroutinefunction()`.
|
|
129
|
+
|
|
130
|
+
Example:
|
|
131
|
+
Before:
|
|
132
|
+
import asyncio
|
|
133
|
+
asyncio.iscoroutinefunction(handler)
|
|
134
|
+
|
|
135
|
+
After:
|
|
136
|
+
import inspect
|
|
137
|
+
inspect.iscoroutinefunction(handler)
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
@property
|
|
141
|
+
def name(self) -> str:
|
|
142
|
+
return "org.openrewrite.python.migrate.ReplaceAsyncioIscoroutinefunction"
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def display_name(self) -> str:
|
|
146
|
+
return "Replace `asyncio.iscoroutinefunction()` with `inspect.iscoroutinefunction()`"
|
|
147
|
+
|
|
148
|
+
@property
|
|
149
|
+
def description(self) -> str:
|
|
150
|
+
return (
|
|
151
|
+
"`asyncio.iscoroutinefunction()` was deprecated in Python 3.14 and is scheduled for "
|
|
152
|
+
"removal in Python 3.16. Use `inspect.iscoroutinefunction()` instead."
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
@property
|
|
156
|
+
def tags(self) -> List[str]:
|
|
157
|
+
return ["python", "migration", "3.14", "3.16", "asyncio"]
|
|
158
|
+
|
|
159
|
+
def recipe_list(self) -> List[Recipe]:
|
|
160
|
+
return [
|
|
161
|
+
ChangeImport(
|
|
162
|
+
old_module="asyncio",
|
|
163
|
+
old_name="iscoroutinefunction",
|
|
164
|
+
new_module="inspect",
|
|
165
|
+
new_name="iscoroutinefunction",
|
|
166
|
+
)
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
_POLICY_MESSAGE = (
|
|
171
|
+
"The asyncio policy system is deprecated and removed in Python 3.16. "
|
|
172
|
+
"Pass loop_factory to asyncio.run() or asyncio.Runner instead."
|
|
173
|
+
)
|
|
174
|
+
_POLICY_MEMBERS = (
|
|
175
|
+
"AbstractEventLoopPolicy",
|
|
176
|
+
"DefaultEventLoopPolicy",
|
|
177
|
+
"WindowsSelectorEventLoopPolicy",
|
|
178
|
+
"WindowsProactorEventLoopPolicy",
|
|
179
|
+
"get_event_loop_policy",
|
|
180
|
+
"set_event_loop_policy",
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
@categorize(_Python314)
|
|
185
|
+
class FindAsyncioEventLoopPolicy(Recipe):
|
|
186
|
+
"""
|
|
187
|
+
Find uses of the asyncio policy system, deprecated in Python 3.14 and
|
|
188
|
+
scheduled for removal in Python 3.16.
|
|
189
|
+
|
|
190
|
+
Example:
|
|
191
|
+
Before:
|
|
192
|
+
import asyncio
|
|
193
|
+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
194
|
+
asyncio.run(main())
|
|
195
|
+
|
|
196
|
+
After:
|
|
197
|
+
import asyncio
|
|
198
|
+
asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
@property
|
|
202
|
+
def name(self) -> str:
|
|
203
|
+
return "org.openrewrite.python.migrate.FindAsyncioEventLoopPolicy"
|
|
204
|
+
|
|
205
|
+
@property
|
|
206
|
+
def display_name(self) -> str:
|
|
207
|
+
return "Find deprecated asyncio event loop policies"
|
|
208
|
+
|
|
209
|
+
@property
|
|
210
|
+
def description(self) -> str:
|
|
211
|
+
return (
|
|
212
|
+
"The asyncio policy system (`get_event_loop_policy()`, `set_event_loop_policy()` and the "
|
|
213
|
+
"`*EventLoopPolicy` classes) was deprecated in Python 3.14 and is scheduled for removal "
|
|
214
|
+
"in Python 3.16. Pass `loop_factory` to `asyncio.run()` or `asyncio.Runner` instead."
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
@property
|
|
218
|
+
def tags(self) -> List[str]:
|
|
219
|
+
return ["python", "migration", "3.14", "3.16", "asyncio"]
|
|
220
|
+
|
|
221
|
+
def editor(self) -> TreeVisitor[Any, ExecutionContext]:
|
|
222
|
+
return find_member_references({f"asyncio.{member}": _POLICY_MESSAGE for member in _POLICY_MEMBERS})
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Recipe for finding bitwise inversion of a `bool`.
|
|
3
|
+
|
|
4
|
+
`~True` and `~False` were deprecated in Python 3.12 and are scheduled for
|
|
5
|
+
removal in Python 3.16.
|
|
6
|
+
|
|
7
|
+
See: https://docs.python.org/3/deprecations/pending-removal-in-3.16.html
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import Any, List
|
|
11
|
+
|
|
12
|
+
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
13
|
+
from rewrite.category import CategoryDescriptor
|
|
14
|
+
from rewrite.decorators import categorize
|
|
15
|
+
from rewrite.java.support_types import JavaType
|
|
16
|
+
from rewrite.java.tree import J, Literal, Unary
|
|
17
|
+
from rewrite.marketplace import Python
|
|
18
|
+
from rewrite.python.visitor import PythonVisitor
|
|
19
|
+
|
|
20
|
+
from ._markers import mark_deprecated
|
|
21
|
+
|
|
22
|
+
# Define category path: Python > Migrate > Python 3.12
|
|
23
|
+
_Python312 = [
|
|
24
|
+
*Python,
|
|
25
|
+
CategoryDescriptor(display_name="Migrate"),
|
|
26
|
+
CategoryDescriptor(display_name="Python 3.12"),
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@categorize(_Python312)
|
|
31
|
+
class FindBitwiseInversionOnBool(Recipe):
|
|
32
|
+
"""
|
|
33
|
+
Find `~` applied to a `bool`, deprecated in Python 3.12 and scheduled
|
|
34
|
+
for removal in Python 3.16.
|
|
35
|
+
|
|
36
|
+
`~True` is `-2` and `~False` is `-1`, both truthy, so `~flag` almost
|
|
37
|
+
always meant `not flag`.
|
|
38
|
+
|
|
39
|
+
Example:
|
|
40
|
+
Before:
|
|
41
|
+
def toggle(enabled: bool) -> bool:
|
|
42
|
+
return ~enabled
|
|
43
|
+
|
|
44
|
+
After:
|
|
45
|
+
def toggle(enabled: bool) -> bool:
|
|
46
|
+
return not enabled
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def name(self) -> str:
|
|
51
|
+
return "org.openrewrite.python.migrate.FindBitwiseInversionOnBool"
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def display_name(self) -> str:
|
|
55
|
+
return "Find bitwise inversion `~` on a `bool`"
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def description(self) -> str:
|
|
59
|
+
return (
|
|
60
|
+
"Bitwise inversion of a `bool` (`~True` is `-2`) was deprecated in Python 3.12 and is "
|
|
61
|
+
"scheduled for removal in Python 3.16. Use `not x` for logical negation, or `~int(x)` "
|
|
62
|
+
"for the integer inversion. Only fires on a `bool` literal or where the operand's type "
|
|
63
|
+
"resolves to `bool`."
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
def tags(self) -> List[str]:
|
|
68
|
+
return ["python", "migration", "3.12", "3.16"]
|
|
69
|
+
|
|
70
|
+
def editor(self) -> TreeVisitor[Any, ExecutionContext]:
|
|
71
|
+
class Visitor(PythonVisitor[ExecutionContext]):
|
|
72
|
+
def visit_unary(self, unary: Unary, p: ExecutionContext) -> J:
|
|
73
|
+
u = super().visit_unary(unary, p)
|
|
74
|
+
if (
|
|
75
|
+
isinstance(u, Unary)
|
|
76
|
+
and u.operator == Unary.Type.Complement
|
|
77
|
+
and (
|
|
78
|
+
u.expression.type == JavaType.Primitive.Boolean
|
|
79
|
+
or (isinstance(u.expression, Literal) and isinstance(u.expression.value, bool))
|
|
80
|
+
)
|
|
81
|
+
):
|
|
82
|
+
return mark_deprecated(
|
|
83
|
+
u,
|
|
84
|
+
"Bitwise inversion of a bool is deprecated and removed in Python 3.16. "
|
|
85
|
+
"Use `not x`, or `~int(x)` for the integer inversion.",
|
|
86
|
+
)
|
|
87
|
+
return u
|
|
88
|
+
|
|
89
|
+
return Visitor()
|
|
@@ -4,17 +4,22 @@ Recipes for migrating deprecated collections imports to collections.abc.
|
|
|
4
4
|
The abstract base classes were moved from `collections` to `collections.abc`
|
|
5
5
|
in Python 3.3 and the old import locations were removed in Python 3.10.
|
|
6
6
|
|
|
7
|
+
``collections.abc.ByteString`` itself, and the ``typing.ByteString`` alias,
|
|
8
|
+
are scheduled for removal in Python 3.17; ``FindByteString`` reports them.
|
|
9
|
+
|
|
7
10
|
See: https://docs.python.org/3/library/collections.abc.html
|
|
8
11
|
"""
|
|
9
12
|
|
|
10
|
-
from typing import List
|
|
13
|
+
from typing import Any, List
|
|
11
14
|
|
|
12
|
-
from rewrite import Recipe
|
|
15
|
+
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
13
16
|
from rewrite.category import CategoryDescriptor
|
|
14
17
|
from rewrite.decorators import categorize
|
|
15
18
|
from rewrite.marketplace import Python
|
|
16
19
|
from rewrite.python.recipes import ChangeImport
|
|
17
20
|
|
|
21
|
+
from ._finders import find_member_references
|
|
22
|
+
|
|
18
23
|
# Define category path: Python > Migrate > Python 3.10
|
|
19
24
|
_Python310 = [
|
|
20
25
|
*Python,
|
|
@@ -22,6 +27,13 @@ _Python310 = [
|
|
|
22
27
|
CategoryDescriptor(display_name="Python 3.10"),
|
|
23
28
|
]
|
|
24
29
|
|
|
30
|
+
# Define category path: Python > Migrate > Python 3.12
|
|
31
|
+
_Python312 = [
|
|
32
|
+
*Python,
|
|
33
|
+
CategoryDescriptor(display_name="Migrate"),
|
|
34
|
+
CategoryDescriptor(display_name="Python 3.12"),
|
|
35
|
+
]
|
|
36
|
+
|
|
25
37
|
# All ABC aliases that `collections` re-exported until their removal in
|
|
26
38
|
# Python 3.10 (`_collections_abc.__all__` as of Python 3.9).
|
|
27
39
|
COLLECTIONS_ABC_CLASSES: tuple = (
|
|
@@ -98,3 +110,55 @@ class ReplaceCollectionsAbcImports(Recipe):
|
|
|
98
110
|
)
|
|
99
111
|
for abc_class in COLLECTIONS_ABC_CLASSES
|
|
100
112
|
]
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
_BYTESTRING_MESSAGE = (
|
|
116
|
+
"ByteString is deprecated and removed in Python 3.17. Use collections.abc.Buffer, "
|
|
117
|
+
"or a union such as bytes | bytearray | memoryview."
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@categorize(_Python312)
|
|
122
|
+
class FindByteString(Recipe):
|
|
123
|
+
"""
|
|
124
|
+
Find references to `collections.abc.ByteString` and
|
|
125
|
+
`typing.ByteString`, scheduled for removal in Python 3.17.
|
|
126
|
+
|
|
127
|
+
Example:
|
|
128
|
+
Before:
|
|
129
|
+
from collections.abc import ByteString
|
|
130
|
+
|
|
131
|
+
def checksum(data: ByteString) -> int: ...
|
|
132
|
+
|
|
133
|
+
After:
|
|
134
|
+
from collections.abc import Buffer
|
|
135
|
+
|
|
136
|
+
def checksum(data: Buffer) -> int: ...
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
@property
|
|
140
|
+
def name(self) -> str:
|
|
141
|
+
return "org.openrewrite.python.migrate.FindByteString"
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def display_name(self) -> str:
|
|
145
|
+
return "Find deprecated `ByteString`"
|
|
146
|
+
|
|
147
|
+
@property
|
|
148
|
+
def description(self) -> str:
|
|
149
|
+
return (
|
|
150
|
+
"`collections.abc.ByteString` (deprecated in Python 3.12) and `typing.ByteString` "
|
|
151
|
+
"(deprecated in Python 3.9) are scheduled for removal in Python 3.17. Use "
|
|
152
|
+
"`collections.abc.Buffer` to accept any buffer, or a union of the types the code "
|
|
153
|
+
"supports, such as `bytes | bytearray | memoryview`."
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def tags(self) -> List[str]:
|
|
158
|
+
return ["python", "migration", "3.12", "3.17", "typing"]
|
|
159
|
+
|
|
160
|
+
def editor(self) -> TreeVisitor[Any, ExecutionContext]:
|
|
161
|
+
return find_member_references({
|
|
162
|
+
"collections.abc.ByteString": _BYTESTRING_MESSAGE,
|
|
163
|
+
"typing.ByteString": _BYTESTRING_MESSAGE,
|
|
164
|
+
})
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Recipe for finding the deprecated `profile` module.
|
|
3
|
+
|
|
4
|
+
The `profile` module was deprecated in Python 3.15 and is scheduled for
|
|
5
|
+
removal in Python 3.17.
|
|
6
|
+
|
|
7
|
+
See: https://docs.python.org/3/deprecations/pending-removal-in-3.17.html
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import Any, List
|
|
11
|
+
|
|
12
|
+
from rewrite import ExecutionContext, Recipe, TreeVisitor
|
|
13
|
+
from rewrite.category import CategoryDescriptor
|
|
14
|
+
from rewrite.decorators import categorize
|
|
15
|
+
from rewrite.marketplace import Python
|
|
16
|
+
|
|
17
|
+
from ._module_imports import find_module_imports
|
|
18
|
+
|
|
19
|
+
# Define category path: Python > Migrate > Python 3.15
|
|
20
|
+
_Python315 = [
|
|
21
|
+
*Python,
|
|
22
|
+
CategoryDescriptor(display_name="Migrate"),
|
|
23
|
+
CategoryDescriptor(display_name="Python 3.15"),
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@categorize(_Python315)
|
|
28
|
+
class FindProfileModule(Recipe):
|
|
29
|
+
"""
|
|
30
|
+
Find imports of the `profile` module, deprecated in Python 3.15 and
|
|
31
|
+
scheduled for removal in Python 3.17.
|
|
32
|
+
|
|
33
|
+
Example:
|
|
34
|
+
Before:
|
|
35
|
+
import profile
|
|
36
|
+
profile.run("main()")
|
|
37
|
+
|
|
38
|
+
After:
|
|
39
|
+
import cProfile
|
|
40
|
+
cProfile.run("main()")
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def name(self) -> str:
|
|
45
|
+
return "org.openrewrite.python.migrate.FindProfileModule"
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def display_name(self) -> str:
|
|
49
|
+
return "Find deprecated `profile` module"
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def description(self) -> str:
|
|
53
|
+
return (
|
|
54
|
+
"The pure-Python `profile` module was deprecated in Python 3.15 and is scheduled for "
|
|
55
|
+
"removal in Python 3.17. Use `profiling.tracing` (new in 3.15) or `cProfile`, which "
|
|
56
|
+
"provide a compatible API but no custom timers or bias calibration."
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def tags(self) -> List[str]:
|
|
61
|
+
return ["python", "migration", "3.15", "3.17", "profile"]
|
|
62
|
+
|
|
63
|
+
def editor(self) -> TreeVisitor[Any, ExecutionContext]:
|
|
64
|
+
return find_module_imports(
|
|
65
|
+
"profile",
|
|
66
|
+
"The `profile` module is deprecated and removed in Python 3.17. "
|
|
67
|
+
"Use `profiling.tracing` or `cProfile` instead.",
|
|
68
|
+
)
|