openrewrite-migrate-python 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openrewrite_migrate_python-0.1.0/PKG-INFO +31 -0
- openrewrite_migrate_python-0.1.0/pyproject.toml +71 -0
- openrewrite_migrate_python-0.1.0/setup.cfg +4 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/__init__.py +35 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/__init__.py +219 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/aifc_migrations.py +517 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/array_deprecations.py +133 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/ast_deprecations.py +322 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/asyncio_coroutine_to_async.py +225 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/asyncio_deprecations.py +117 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/calendar_deprecations.py +134 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/cgi_migrations.py +213 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/cgi_parse_deprecations.py +170 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/collections_abc_migrations.py +207 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/configparser_deprecations.py +252 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/datetime_utc.py +136 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/distutils_deprecations.py +107 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/distutils_migrations.py +125 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/functools_deprecations.py +98 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/gettext_deprecations.py +139 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/html_parser_deprecations.py +110 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/imp_migrations.py +135 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/langchain_classic_imports.py +308 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/langchain_community_imports.py +154 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/langchain_provider_imports.py +240 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/locale_deprecations.py +177 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/locale_getdefaultlocale_deprecation.py +103 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/macpath_deprecations.py +125 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/mailcap_migrations.py +129 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/nntplib_migrations.py +127 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/os_deprecations.py +158 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/pathlib_deprecations.py +98 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/pep594_system_migrations.py +429 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/pipes_migrations.py +130 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/pkgutil_deprecations.py +180 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/platform_deprecations.py +99 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/re_deprecations.py +122 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/removed_modules_312.py +139 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/shutil_deprecations.py +112 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/socket_deprecations.py +96 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/ssl_deprecations.py +121 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/string_formatting.py +526 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/sys_deprecations.py +97 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/sys_last_deprecations.py +104 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/tarfile_deprecations.py +120 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/telnetlib_migrations.py +132 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/tempfile_deprecations.py +113 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/threading_deprecations.py +488 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/threading_is_alive_deprecation.py +82 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/typing_callable.py +153 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/typing_deprecations.py +337 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/typing_union_to_pipe.py +272 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/unittest_deprecations.py +140 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_langchain02.py +56 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_langchain1.py +66 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_python310.py +91 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_python311.py +92 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_python312.py +101 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_python313.py +109 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_python314.py +87 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_python38.py +85 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/upgrade_to_python39.py +125 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/urllib_deprecations.py +204 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/uu_migrations.py +129 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/xdrlib_migrations.py +129 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python/migrate/xml_deprecations.py +154 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python.egg-info/PKG-INFO +31 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python.egg-info/SOURCES.txt +113 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python.egg-info/dependency_links.txt +1 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python.egg-info/entry_points.txt +2 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python.egg-info/requires.txt +11 -0
- openrewrite_migrate_python-0.1.0/src/openrewrite_migrate_python.egg-info/top_level.txt +1 -0
- openrewrite_migrate_python-0.1.0/tests/test_aifc_migrations.py +134 -0
- openrewrite_migrate_python-0.1.0/tests/test_array_deprecations.py +48 -0
- openrewrite_migrate_python-0.1.0/tests/test_ast_deprecations.py +155 -0
- openrewrite_migrate_python-0.1.0/tests/test_asyncio_coroutine_to_async.py +134 -0
- openrewrite_migrate_python-0.1.0/tests/test_asyncio_deprecations.py +64 -0
- openrewrite_migrate_python-0.1.0/tests/test_calendar_deprecations.py +89 -0
- openrewrite_migrate_python-0.1.0/tests/test_cgi_parse_deprecations.py +46 -0
- openrewrite_migrate_python-0.1.0/tests/test_change_import_recipes.py +140 -0
- openrewrite_migrate_python-0.1.0/tests/test_collections_abc_migrations.py +167 -0
- openrewrite_migrate_python-0.1.0/tests/test_configparser_deprecations.py +166 -0
- openrewrite_migrate_python-0.1.0/tests/test_datetime_utc.py +89 -0
- openrewrite_migrate_python-0.1.0/tests/test_distutils_deprecations.py +49 -0
- openrewrite_migrate_python-0.1.0/tests/test_gettext_deprecations.py +86 -0
- openrewrite_migrate_python-0.1.0/tests/test_html_parser_deprecations.py +26 -0
- openrewrite_migrate_python-0.1.0/tests/test_imp_migrations.py +66 -0
- openrewrite_migrate_python-0.1.0/tests/test_langchain_classic_imports.py +225 -0
- openrewrite_migrate_python-0.1.0/tests/test_langchain_community_imports.py +253 -0
- openrewrite_migrate_python-0.1.0/tests/test_langchain_provider_imports.py +231 -0
- openrewrite_migrate_python-0.1.0/tests/test_locale_deprecations.py +55 -0
- openrewrite_migrate_python-0.1.0/tests/test_locale_getdefaultlocale_deprecation.py +26 -0
- openrewrite_migrate_python-0.1.0/tests/test_macpath_deprecations.py +24 -0
- openrewrite_migrate_python-0.1.0/tests/test_os_deprecations.py +63 -0
- openrewrite_migrate_python-0.1.0/tests/test_pep594_migrations.py +125 -0
- openrewrite_migrate_python-0.1.0/tests/test_pep594_system_migrations.py +123 -0
- openrewrite_migrate_python-0.1.0/tests/test_pkgutil_deprecations.py +76 -0
- openrewrite_migrate_python-0.1.0/tests/test_platform_deprecations.py +24 -0
- openrewrite_migrate_python-0.1.0/tests/test_re_deprecations.py +33 -0
- openrewrite_migrate_python-0.1.0/tests/test_removed_modules_312.py +97 -0
- openrewrite_migrate_python-0.1.0/tests/test_shutil_deprecations.py +26 -0
- openrewrite_migrate_python-0.1.0/tests/test_ssl_deprecations.py +56 -0
- openrewrite_migrate_python-0.1.0/tests/test_string_formatting.py +439 -0
- openrewrite_migrate_python-0.1.0/tests/test_sys_deprecations.py +33 -0
- openrewrite_migrate_python-0.1.0/tests/test_sys_last_deprecations.py +35 -0
- openrewrite_migrate_python-0.1.0/tests/test_tarfile_deprecations.py +24 -0
- openrewrite_migrate_python-0.1.0/tests/test_threading_deprecations.py +80 -0
- openrewrite_migrate_python-0.1.0/tests/test_threading_extended.py +94 -0
- openrewrite_migrate_python-0.1.0/tests/test_threading_is_alive_deprecation.py +32 -0
- openrewrite_migrate_python-0.1.0/tests/test_typing_callable.py +57 -0
- openrewrite_migrate_python-0.1.0/tests/test_typing_deprecations.py +38 -0
- openrewrite_migrate_python-0.1.0/tests/test_typing_union_to_pipe.py +229 -0
- openrewrite_migrate_python-0.1.0/tests/test_unittest_deprecations.py +127 -0
- openrewrite_migrate_python-0.1.0/tests/test_upgrade_recipes.py +135 -0
- openrewrite_migrate_python-0.1.0/tests/test_xml_deprecations.py +60 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openrewrite-migrate-python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: OpenRewrite recipes for migrating Python codebases to newer Python versions.
|
|
5
|
+
Author-email: "Moderne Inc." <support@moderne.io>
|
|
6
|
+
License: Moderne Proprietary
|
|
7
|
+
Project-URL: Homepage, https://github.com/openrewrite/rewrite-migrate-python
|
|
8
|
+
Project-URL: Repository, https://github.com/openrewrite/rewrite-migrate-python.git
|
|
9
|
+
Project-URL: Documentation, https://docs.openrewrite.org
|
|
10
|
+
Project-URL: Issues, https://github.com/openrewrite/rewrite-migrate-python/issues
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: Other/Proprietary License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: openrewrite>=8.74.0.dev20260224100132
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
27
|
+
Requires-Dist: black>=24.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
29
|
+
Provides-Extra: publish
|
|
30
|
+
Requires-Dist: build>=1.0.0; extra == "publish"
|
|
31
|
+
Requires-Dist: twine>=5.0.0; extra == "publish"
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "openrewrite-migrate-python"
|
|
7
|
+
description = "OpenRewrite recipes for migrating Python codebases to newer Python versions."
|
|
8
|
+
version = "0.1.0" # Updated dynamically during release
|
|
9
|
+
authors = [{ name = "Moderne Inc.", email = "support@moderne.io" }]
|
|
10
|
+
license = { text = "Moderne Proprietary" }
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: Other/Proprietary License",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Topic :: Software Development :: Code Generators",
|
|
21
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
22
|
+
"Typing :: Typed",
|
|
23
|
+
]
|
|
24
|
+
requires-python = ">=3.10"
|
|
25
|
+
dependencies = [
|
|
26
|
+
"openrewrite>=8.74.0.dev20260224100132",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
dev = [
|
|
31
|
+
"pytest>=8.0.0",
|
|
32
|
+
"pytest-cov>=4.0.0",
|
|
33
|
+
"black>=24.0.0",
|
|
34
|
+
"ruff>=0.1.0",
|
|
35
|
+
]
|
|
36
|
+
publish = [
|
|
37
|
+
"build>=1.0.0",
|
|
38
|
+
"twine>=5.0.0",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://github.com/openrewrite/rewrite-migrate-python"
|
|
43
|
+
Repository = "https://github.com/openrewrite/rewrite-migrate-python.git"
|
|
44
|
+
Documentation = "https://docs.openrewrite.org"
|
|
45
|
+
Issues = "https://github.com/openrewrite/rewrite-migrate-python/issues"
|
|
46
|
+
|
|
47
|
+
[project.entry-points."openrewrite.recipes"]
|
|
48
|
+
migrate_python = "openrewrite_migrate_python:activate"
|
|
49
|
+
|
|
50
|
+
[tool.setuptools.packages.find]
|
|
51
|
+
where = ["src"]
|
|
52
|
+
include = ["openrewrite_migrate_python", "openrewrite_migrate_python.*"]
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.package-data]
|
|
55
|
+
"*" = ["py.typed", "*.pyi"]
|
|
56
|
+
|
|
57
|
+
[tool.black]
|
|
58
|
+
line-length = 120
|
|
59
|
+
target-version = ["py310", "py311", "py312", "py313"]
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
line-length = 120
|
|
63
|
+
target-version = "py310"
|
|
64
|
+
|
|
65
|
+
[tool.ruff.lint]
|
|
66
|
+
select = ["E", "F", "I", "UP"]
|
|
67
|
+
|
|
68
|
+
[tool.pytest.ini_options]
|
|
69
|
+
testpaths = ["tests"]
|
|
70
|
+
python_files = ["test_*.py", "*_test.py"]
|
|
71
|
+
python_functions = ["test_*"]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""OpenRewrite recipes for migrating Python codebases to newer Python versions."""
|
|
2
|
+
|
|
3
|
+
import importlib
|
|
4
|
+
import inspect
|
|
5
|
+
import pkgutil
|
|
6
|
+
|
|
7
|
+
from rewrite import Recipe, RecipeMarketplace
|
|
8
|
+
|
|
9
|
+
__all__ = ["activate"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def activate(marketplace: RecipeMarketplace) -> None:
|
|
13
|
+
"""
|
|
14
|
+
Install all migration recipes into the marketplace.
|
|
15
|
+
|
|
16
|
+
This function is called by the OpenRewrite discovery mechanism when the
|
|
17
|
+
openrewrite-migrate-python package is found via entry points.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
marketplace: The RecipeMarketplace to install recipes into
|
|
21
|
+
"""
|
|
22
|
+
from rewrite.decorators import get_recipe_category
|
|
23
|
+
|
|
24
|
+
from . import migrate as migrate_pkg
|
|
25
|
+
|
|
26
|
+
# Auto-discover all Recipe subclasses from the migrate package
|
|
27
|
+
for module_info in pkgutil.walk_packages(
|
|
28
|
+
migrate_pkg.__path__, prefix=migrate_pkg.__name__ + "."
|
|
29
|
+
):
|
|
30
|
+
module = importlib.import_module(module_info.name)
|
|
31
|
+
for _name, obj in inspect.getmembers(module, inspect.isclass):
|
|
32
|
+
if issubclass(obj, Recipe) and obj is not Recipe and obj.__module__ == module.__name__:
|
|
33
|
+
category = get_recipe_category(obj)
|
|
34
|
+
if category is not None:
|
|
35
|
+
marketplace.install(obj, category)
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"""Python version and library migration recipes."""
|
|
2
|
+
|
|
3
|
+
# LangChain migration recipes
|
|
4
|
+
from .langchain_classic_imports import (
|
|
5
|
+
FindDeprecatedLangchainAgents,
|
|
6
|
+
ReplaceLangchainClassicImports,
|
|
7
|
+
FindLangchainCreateReactAgent,
|
|
8
|
+
)
|
|
9
|
+
from .langchain_community_imports import ReplaceLangchainCommunityImports
|
|
10
|
+
from .langchain_provider_imports import ReplaceLangchainProviderImports
|
|
11
|
+
from .upgrade_to_langchain02 import UpgradeToLangChain02
|
|
12
|
+
from .upgrade_to_langchain1 import UpgradeToLangChain1
|
|
13
|
+
|
|
14
|
+
# PEP 594 dead batteries - additional modules
|
|
15
|
+
from .aifc_migrations import (
|
|
16
|
+
FindAifcModule,
|
|
17
|
+
FindAudioopModule,
|
|
18
|
+
FindChunkModule,
|
|
19
|
+
FindImghdrModule,
|
|
20
|
+
FindSndhdrModule,
|
|
21
|
+
FindSunauModule,
|
|
22
|
+
)
|
|
23
|
+
from .array_deprecations import ReplaceArrayFromstring, ReplaceArrayTostring
|
|
24
|
+
from .ast_deprecations import (
|
|
25
|
+
ReplaceAstBytes,
|
|
26
|
+
ReplaceAstEllipsis,
|
|
27
|
+
ReplaceAstNameConstant,
|
|
28
|
+
ReplaceAstNum,
|
|
29
|
+
ReplaceAstStr,
|
|
30
|
+
)
|
|
31
|
+
from .asyncio_coroutine_to_async import MigrateAsyncioCoroutine
|
|
32
|
+
from .asyncio_deprecations import FindAsyncioCoroutineDecorator
|
|
33
|
+
from .calendar_deprecations import ReplaceCalendarConstants
|
|
34
|
+
from .cgi_migrations import FindCgiModule, FindCgitbModule
|
|
35
|
+
from .cgi_parse_deprecations import FindCgiParseQs, FindCgiParseQsl
|
|
36
|
+
from .collections_abc_migrations import ReplaceCollectionsAbcImports
|
|
37
|
+
from .configparser_deprecations import (
|
|
38
|
+
ReplaceConfigparserReadfp,
|
|
39
|
+
ReplaceConfigparserSafeConfigParser,
|
|
40
|
+
)
|
|
41
|
+
from .datetime_utc import ReplaceDatetimeUtcFromTimestamp, ReplaceDatetimeUtcNow
|
|
42
|
+
from .distutils_deprecations import FindDistutilsUsage
|
|
43
|
+
from .distutils_migrations import ReplaceDistutilsVersion
|
|
44
|
+
from .functools_deprecations import FindFunctoolsCmpToKey
|
|
45
|
+
from .gettext_deprecations import ReplaceGettextDeprecations
|
|
46
|
+
from .html_parser_deprecations import FindHtmlParserUnescape
|
|
47
|
+
from .imp_migrations import FindImpUsage
|
|
48
|
+
from .locale_deprecations import ReplaceLocaleResetlocale
|
|
49
|
+
from .locale_getdefaultlocale_deprecation import FindLocaleGetdefaultlocale
|
|
50
|
+
from .macpath_deprecations import FindMacpathModule
|
|
51
|
+
from .mailcap_migrations import FindMailcapModule
|
|
52
|
+
from .nntplib_migrations import FindNntplibModule
|
|
53
|
+
from .os_deprecations import FindOsPopen, FindOsSpawn
|
|
54
|
+
from .pathlib_deprecations import FindPathlibLinkTo
|
|
55
|
+
from .platform_deprecations import FindPlatformPopen
|
|
56
|
+
from .pep594_system_migrations import (
|
|
57
|
+
FindCryptModule,
|
|
58
|
+
FindMsilibModule,
|
|
59
|
+
FindNisModule,
|
|
60
|
+
FindOssaudiodevModule,
|
|
61
|
+
FindSpwdModule,
|
|
62
|
+
)
|
|
63
|
+
from .pipes_migrations import FindPipesModule
|
|
64
|
+
from .pkgutil_deprecations import ReplacePkgutilFindLoader, ReplacePkgutilGetLoader
|
|
65
|
+
from .re_deprecations import FindReTemplate
|
|
66
|
+
from .removed_modules_312 import FindRemovedModules312
|
|
67
|
+
from .shutil_deprecations import FindShutilRmtreeOnerror
|
|
68
|
+
from .socket_deprecations import FindSocketGetFQDN
|
|
69
|
+
from .ssl_deprecations import FindSslMatchHostname
|
|
70
|
+
from .string_formatting import ReplacePercentFormatWithFString, ReplaceStrFormatWithFString
|
|
71
|
+
from .sys_deprecations import FindSysCoroutineWrapper
|
|
72
|
+
from .sys_last_deprecations import FindSysLastExcInfo
|
|
73
|
+
from .tarfile_deprecations import FindTarfileFilemode
|
|
74
|
+
from .telnetlib_migrations import FindTelnetlibModule
|
|
75
|
+
from .tempfile_deprecations import FindTempfileMktemp
|
|
76
|
+
from .threading_is_alive_deprecation import ReplaceThreadIsAlive
|
|
77
|
+
from .threading_deprecations import (
|
|
78
|
+
ReplaceConditionNotifyAll,
|
|
79
|
+
ReplaceEventIsSet,
|
|
80
|
+
ReplaceThreadGetName,
|
|
81
|
+
ReplaceThreadIsDaemon,
|
|
82
|
+
ReplaceThreadSetDaemon,
|
|
83
|
+
ReplaceThreadSetName,
|
|
84
|
+
ReplaceThreadingActiveCount,
|
|
85
|
+
ReplaceThreadingCurrentThread,
|
|
86
|
+
)
|
|
87
|
+
from .typing_callable import ReplaceTypingCallableWithCollectionsAbcCallable
|
|
88
|
+
from .typing_union_to_pipe import (
|
|
89
|
+
ReplaceTypingOptionalWithUnion,
|
|
90
|
+
ReplaceTypingUnionWithPipe,
|
|
91
|
+
)
|
|
92
|
+
from .unittest_deprecations import ReplaceUnittestDeprecatedAliases
|
|
93
|
+
from .upgrade_to_python38 import UpgradeToPython38
|
|
94
|
+
from .upgrade_to_python39 import UpgradeToPython39
|
|
95
|
+
from .upgrade_to_python310 import UpgradeToPython310
|
|
96
|
+
from .upgrade_to_python311 import UpgradeToPython311
|
|
97
|
+
from .upgrade_to_python312 import UpgradeToPython312
|
|
98
|
+
from .upgrade_to_python313 import UpgradeToPython313
|
|
99
|
+
from .upgrade_to_python314 import UpgradeToPython314
|
|
100
|
+
from .urllib_deprecations import FindUrllibParseSplitFunctions, FindUrllibParseToBytes
|
|
101
|
+
from .uu_migrations import FindUuModule
|
|
102
|
+
from .xdrlib_migrations import FindXdrlibModule
|
|
103
|
+
from .xml_deprecations import FindElementGetchildren, ReplaceElementGetiterator
|
|
104
|
+
|
|
105
|
+
__all__ = [
|
|
106
|
+
# String formatting auto-fix recipes
|
|
107
|
+
"ReplacePercentFormatWithFString",
|
|
108
|
+
"ReplaceStrFormatWithFString",
|
|
109
|
+
"FindAifcModule",
|
|
110
|
+
"FindAsyncioCoroutineDecorator",
|
|
111
|
+
"FindAudioopModule",
|
|
112
|
+
"FindCgiModule",
|
|
113
|
+
"FindCgiParseQs",
|
|
114
|
+
"FindCgiParseQsl",
|
|
115
|
+
"FindCgitbModule",
|
|
116
|
+
"FindChunkModule",
|
|
117
|
+
"FindCryptModule",
|
|
118
|
+
"FindDistutilsUsage",
|
|
119
|
+
"FindElementGetchildren",
|
|
120
|
+
"FindFunctoolsCmpToKey",
|
|
121
|
+
"FindHtmlParserUnescape",
|
|
122
|
+
"FindImghdrModule",
|
|
123
|
+
"FindImpUsage",
|
|
124
|
+
"FindMacpathModule",
|
|
125
|
+
"FindMailcapModule",
|
|
126
|
+
"FindMsilibModule",
|
|
127
|
+
"FindNisModule",
|
|
128
|
+
"FindNntplibModule",
|
|
129
|
+
"FindLocaleGetdefaultlocale",
|
|
130
|
+
"FindOsPopen",
|
|
131
|
+
"FindOsSpawn",
|
|
132
|
+
"FindOssaudiodevModule",
|
|
133
|
+
"FindPathlibLinkTo",
|
|
134
|
+
"FindPipesModule",
|
|
135
|
+
"FindPlatformPopen",
|
|
136
|
+
"FindReTemplate",
|
|
137
|
+
"FindRemovedModules312",
|
|
138
|
+
"FindShutilRmtreeOnerror",
|
|
139
|
+
"FindSndhdrModule",
|
|
140
|
+
"FindSocketGetFQDN",
|
|
141
|
+
"FindSpwdModule",
|
|
142
|
+
"FindSslMatchHostname",
|
|
143
|
+
"FindSysLastExcInfo",
|
|
144
|
+
"FindSunauModule",
|
|
145
|
+
"FindSysCoroutineWrapper",
|
|
146
|
+
"FindTarfileFilemode",
|
|
147
|
+
"FindTelnetlibModule",
|
|
148
|
+
"FindTempfileMktemp",
|
|
149
|
+
"ReplaceThreadGetName",
|
|
150
|
+
"ReplaceThreadIsDaemon",
|
|
151
|
+
"ReplaceThreadSetDaemon",
|
|
152
|
+
"ReplaceThreadSetName",
|
|
153
|
+
"FindUrllibParseSplitFunctions",
|
|
154
|
+
"FindUrllibParseToBytes",
|
|
155
|
+
"FindUuModule",
|
|
156
|
+
"FindXdrlibModule",
|
|
157
|
+
# Auto-fix: Array
|
|
158
|
+
"ReplaceArrayFromstring",
|
|
159
|
+
"ReplaceArrayTostring",
|
|
160
|
+
# Auto-fix: AST
|
|
161
|
+
"ReplaceAstBytes",
|
|
162
|
+
"ReplaceAstEllipsis",
|
|
163
|
+
"ReplaceAstNameConstant",
|
|
164
|
+
"ReplaceAstNum",
|
|
165
|
+
"ReplaceAstStr",
|
|
166
|
+
# Auto-fix: Asyncio
|
|
167
|
+
"MigrateAsyncioCoroutine",
|
|
168
|
+
# Auto-fix: Calendar
|
|
169
|
+
"ReplaceCalendarConstants",
|
|
170
|
+
# Auto-fix: Collections
|
|
171
|
+
"ReplaceCollectionsAbcImports",
|
|
172
|
+
# Auto-fix: Configparser
|
|
173
|
+
"ReplaceConfigparserReadfp",
|
|
174
|
+
"ReplaceConfigparserSafeConfigParser",
|
|
175
|
+
# Auto-fix: Datetime
|
|
176
|
+
"ReplaceDatetimeUtcFromTimestamp",
|
|
177
|
+
"ReplaceDatetimeUtcNow",
|
|
178
|
+
# Auto-fix: Distutils
|
|
179
|
+
"ReplaceDistutilsVersion",
|
|
180
|
+
# Auto-fix: Gettext
|
|
181
|
+
"ReplaceGettextDeprecations",
|
|
182
|
+
# Auto-fix: Locale
|
|
183
|
+
"ReplaceLocaleResetlocale",
|
|
184
|
+
# Auto-fix: Pkgutil
|
|
185
|
+
"ReplacePkgutilFindLoader",
|
|
186
|
+
"ReplacePkgutilGetLoader",
|
|
187
|
+
# Auto-fix: Threading
|
|
188
|
+
"ReplaceThreadIsAlive",
|
|
189
|
+
"ReplaceConditionNotifyAll",
|
|
190
|
+
"ReplaceEventIsSet",
|
|
191
|
+
"ReplaceThreadingActiveCount",
|
|
192
|
+
"ReplaceThreadingCurrentThread",
|
|
193
|
+
# Auto-fix: Typing
|
|
194
|
+
"ReplaceTypingCallableWithCollectionsAbcCallable",
|
|
195
|
+
"ReplaceTypingOptionalWithUnion",
|
|
196
|
+
"ReplaceTypingUnionWithPipe",
|
|
197
|
+
# Auto-fix: Unittest
|
|
198
|
+
"ReplaceUnittestDeprecatedAliases",
|
|
199
|
+
# Auto-fix: XML
|
|
200
|
+
"ReplaceElementGetiterator",
|
|
201
|
+
# Auto-fix: LangChain
|
|
202
|
+
"ReplaceLangchainCommunityImports",
|
|
203
|
+
"ReplaceLangchainProviderImports",
|
|
204
|
+
"ReplaceLangchainClassicImports",
|
|
205
|
+
"FindLangchainCreateReactAgent",
|
|
206
|
+
# Detection: LangChain
|
|
207
|
+
"FindDeprecatedLangchainAgents",
|
|
208
|
+
# Composite upgrade recipes: LangChain
|
|
209
|
+
"UpgradeToLangChain02",
|
|
210
|
+
"UpgradeToLangChain1",
|
|
211
|
+
# Composite upgrade recipes: Python
|
|
212
|
+
"UpgradeToPython38",
|
|
213
|
+
"UpgradeToPython39",
|
|
214
|
+
"UpgradeToPython310",
|
|
215
|
+
"UpgradeToPython311",
|
|
216
|
+
"UpgradeToPython312",
|
|
217
|
+
"UpgradeToPython313",
|
|
218
|
+
"UpgradeToPython314",
|
|
219
|
+
]
|