openrewrite-migrate-python 0.1.0.dev20260209140420__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.dev20260209140420/PKG-INFO +31 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/pyproject.toml +71 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/setup.cfg +4 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/__init__.py +115 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/__init__.py +197 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/aifc_migrations.py +442 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/array_deprecations.py +147 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/ast_deprecations.py +336 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/asyncio_coroutine_to_async.py +239 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/asyncio_deprecations.py +131 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/base64_deprecations.py +163 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/calendar_deprecations.py +148 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/cgi_migrations.py +273 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/collections_abc_migrations.py +221 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/configparser_deprecations.py +266 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/datetime_utc.py +240 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/distutils_deprecations.py +121 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/distutils_migrations.py +139 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/functools_deprecations.py +112 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/gettext_deprecations.py +153 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/imp_migrations.py +282 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/inspect_deprecations.py +138 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/locale_deprecations.py +191 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/logging_deprecations.py +109 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/mailcap_migrations.py +128 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/nntplib_migrations.py +126 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/os_deprecations.py +172 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/pathlib_deprecations.py +112 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/pipes_migrations.py +129 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/pkgutil_deprecations.py +194 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/removed_modules_312.py +173 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/socket_deprecations.py +110 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/ssl_deprecations.py +135 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/string_formatting.py +196 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/telnetlib_migrations.py +131 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/tempfile_deprecations.py +127 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/threading_deprecations.py +227 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/typing_builtins.py +131 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/typing_callable.py +108 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/typing_deprecations.py +367 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/typing_union_to_pipe.py +286 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/unittest_deprecations.py +154 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/upgrade_to_python310.py +94 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/upgrade_to_python311.py +107 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/upgrade_to_python312.py +106 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/upgrade_to_python313.py +113 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/upgrade_to_python314.py +101 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/upgrade_to_python38.py +71 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/upgrade_to_python39.py +103 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/urllib_deprecations.py +218 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/uu_migrations.py +128 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/xdrlib_migrations.py +128 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python/migrate/xml_deprecations.py +168 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python.egg-info/PKG-INFO +31 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python.egg-info/SOURCES.txt +86 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python.egg-info/dependency_links.txt +1 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python.egg-info/entry_points.txt +2 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python.egg-info/requires.txt +11 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/src/openrewrite_migrate_python.egg-info/top_level.txt +1 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_aifc_migrations.py +148 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_array_deprecations.py +62 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_ast_deprecations.py +169 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_asyncio_coroutine_to_async.py +148 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_asyncio_deprecations.py +78 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_base64_deprecations.py +74 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_calendar_deprecations.py +103 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_collections_abc_migrations.py +181 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_configparser_deprecations.py +180 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_datetime_utc.py +103 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_distutils_deprecations.py +63 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_gettext_deprecations.py +100 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_imp_migrations.py +80 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_inspect_deprecations.py +107 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_locale_deprecations.py +69 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_logging_deprecations.py +55 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_os_deprecations.py +86 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_pep594_migrations.py +124 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_pkgutil_deprecations.py +90 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_removed_modules_312.py +98 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_ssl_deprecations.py +70 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_string_formatting.py +163 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_threading_deprecations.py +94 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_typing_callable.py +71 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_typing_deprecations.py +52 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_typing_union_to_pipe.py +246 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_unittest_deprecations.py +141 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_upgrade_recipes.py +149 -0
- openrewrite_migrate_python-0.1.0.dev20260209140420/tests/test_xml_deprecations.py +74 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openrewrite-migrate-python
|
|
3
|
+
Version: 0.1.0.dev20260209140420
|
|
4
|
+
Summary: OpenRewrite recipes for migrating Python codebases to newer Python versions.
|
|
5
|
+
Author-email: "Moderne Inc." <support@moderne.io>
|
|
6
|
+
License: Apache-2.0
|
|
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 :: OSI Approved :: Apache Software 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>=0.1.0
|
|
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.dev20260209140420" # Updated dynamically during release
|
|
9
|
+
authors = [{ name = "Moderne Inc.", email = "support@moderne.io" }]
|
|
10
|
+
license = { text = "Apache-2.0" }
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: OSI Approved :: Apache Software 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>=0.1.0",
|
|
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,115 @@
|
|
|
1
|
+
# Copyright 2025 the original author or authors.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""OpenRewrite recipes for migrating Python codebases to newer Python versions."""
|
|
16
|
+
|
|
17
|
+
from rewrite import RecipeMarketplace
|
|
18
|
+
|
|
19
|
+
__all__ = ["activate"]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def activate(marketplace: RecipeMarketplace) -> None:
|
|
23
|
+
"""
|
|
24
|
+
Install all migration recipes into the marketplace.
|
|
25
|
+
|
|
26
|
+
This function is called by the OpenRewrite discovery mechanism when the
|
|
27
|
+
openrewrite-migrate-python package is found via entry points.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
marketplace: The RecipeMarketplace to install recipes into
|
|
31
|
+
"""
|
|
32
|
+
from rewrite.decorators import get_recipe_category
|
|
33
|
+
|
|
34
|
+
# Import datetime recipes (Python 3.12)
|
|
35
|
+
from .migrate.datetime_utc import ReplaceDatetimeUtcNow, ReplaceDatetimeUtcFromTimestamp
|
|
36
|
+
|
|
37
|
+
# Import typing deprecation recipes (Python 3.9, 3.11)
|
|
38
|
+
from .migrate.typing_deprecations import (
|
|
39
|
+
ReplaceTypingListWithList,
|
|
40
|
+
ReplaceTypingDictWithDict,
|
|
41
|
+
ReplaceTypingSetWithSet,
|
|
42
|
+
ReplaceTypingTupleWithTuple,
|
|
43
|
+
ReplaceTypingText,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Import locale deprecation recipes (Python 3.11)
|
|
47
|
+
from .migrate.locale_deprecations import ReplaceLocaleResetlocale
|
|
48
|
+
|
|
49
|
+
# Import pkgutil deprecation recipes (Python 3.12)
|
|
50
|
+
from .migrate.pkgutil_deprecations import ReplacePkgutilFindLoader, ReplacePkgutilGetLoader
|
|
51
|
+
|
|
52
|
+
# Import unittest deprecation recipes (Python 3.11)
|
|
53
|
+
from .migrate.unittest_deprecations import ReplaceUnittestDeprecatedAliases
|
|
54
|
+
|
|
55
|
+
# Import calendar deprecation recipes (Python 3.12)
|
|
56
|
+
from .migrate.calendar_deprecations import ReplaceCalendarConstants
|
|
57
|
+
|
|
58
|
+
# Import asyncio deprecation recipes (Python 3.11)
|
|
59
|
+
from .migrate.asyncio_deprecations import FindAsyncioCoroutineDecorator
|
|
60
|
+
|
|
61
|
+
# Import gettext deprecation recipes (Python 3.11)
|
|
62
|
+
from .migrate.gettext_deprecations import ReplaceGettextDeprecations
|
|
63
|
+
|
|
64
|
+
# Import ssl deprecation recipes (Python 3.12)
|
|
65
|
+
from .migrate.ssl_deprecations import FindSslMatchHostname
|
|
66
|
+
|
|
67
|
+
# Import distutils deprecation recipes (Python 3.12)
|
|
68
|
+
from .migrate.distutils_deprecations import FindDistutilsUsage
|
|
69
|
+
|
|
70
|
+
# Import ast deprecation recipes (Python 3.8)
|
|
71
|
+
from .migrate.ast_deprecations import (
|
|
72
|
+
ReplaceAstNum,
|
|
73
|
+
ReplaceAstStr,
|
|
74
|
+
ReplaceAstBytes,
|
|
75
|
+
ReplaceAstNameConstant,
|
|
76
|
+
ReplaceAstEllipsis,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Import composite upgrade recipes
|
|
80
|
+
from .migrate.upgrade_to_python311 import UpgradeToPython311
|
|
81
|
+
|
|
82
|
+
recipes = [
|
|
83
|
+
# Python 3.8 deprecations
|
|
84
|
+
ReplaceAstNum,
|
|
85
|
+
ReplaceAstStr,
|
|
86
|
+
ReplaceAstBytes,
|
|
87
|
+
ReplaceAstNameConstant,
|
|
88
|
+
ReplaceAstEllipsis,
|
|
89
|
+
# Python 3.9 deprecations (PEP 585)
|
|
90
|
+
ReplaceTypingListWithList,
|
|
91
|
+
ReplaceTypingDictWithDict,
|
|
92
|
+
ReplaceTypingSetWithSet,
|
|
93
|
+
ReplaceTypingTupleWithTuple,
|
|
94
|
+
# Python 3.11 deprecations
|
|
95
|
+
ReplaceTypingText,
|
|
96
|
+
ReplaceLocaleResetlocale,
|
|
97
|
+
ReplaceUnittestDeprecatedAliases,
|
|
98
|
+
FindAsyncioCoroutineDecorator,
|
|
99
|
+
ReplaceGettextDeprecations,
|
|
100
|
+
# Python 3.12 deprecations
|
|
101
|
+
ReplaceDatetimeUtcNow,
|
|
102
|
+
ReplaceDatetimeUtcFromTimestamp,
|
|
103
|
+
ReplacePkgutilFindLoader,
|
|
104
|
+
ReplacePkgutilGetLoader,
|
|
105
|
+
ReplaceCalendarConstants,
|
|
106
|
+
FindSslMatchHostname,
|
|
107
|
+
FindDistutilsUsage,
|
|
108
|
+
# Composite recipes
|
|
109
|
+
UpgradeToPython311,
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
for recipe_class in recipes:
|
|
113
|
+
category = get_recipe_category(recipe_class)
|
|
114
|
+
if category is not None:
|
|
115
|
+
marketplace.install(recipe_class, category)
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Copyright 2025 the original author or authors.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Python version migration recipes."""
|
|
16
|
+
|
|
17
|
+
# PEP 594 dead batteries - additional modules
|
|
18
|
+
from .aifc_migrations import (
|
|
19
|
+
FindAifcModule,
|
|
20
|
+
FindAudioopModule,
|
|
21
|
+
FindChunkModule,
|
|
22
|
+
FindImghdrModule,
|
|
23
|
+
FindSndhdrModule,
|
|
24
|
+
FindSunauModule,
|
|
25
|
+
)
|
|
26
|
+
from .array_deprecations import ReplaceArrayFromstring, ReplaceArrayTostring
|
|
27
|
+
from .ast_deprecations import (
|
|
28
|
+
ReplaceAstBytes,
|
|
29
|
+
ReplaceAstEllipsis,
|
|
30
|
+
ReplaceAstNameConstant,
|
|
31
|
+
ReplaceAstNum,
|
|
32
|
+
ReplaceAstStr,
|
|
33
|
+
)
|
|
34
|
+
from .asyncio_coroutine_to_async import MigrateAsyncioCoroutine
|
|
35
|
+
from .asyncio_deprecations import FindAsyncioCoroutineDecorator
|
|
36
|
+
from .base64_deprecations import ReplaceBase64Decodestring, ReplaceBase64Encodestring
|
|
37
|
+
from .calendar_deprecations import ReplaceCalendarConstants
|
|
38
|
+
from .cgi_migrations import FindCgiModule, FindCgitbModule, ReplaceCgiEscape
|
|
39
|
+
from .collections_abc_migrations import ReplaceCollectionsAbcImports
|
|
40
|
+
from .configparser_deprecations import (
|
|
41
|
+
ReplaceConfigparserReadfp,
|
|
42
|
+
ReplaceConfigparserSafeConfigParser,
|
|
43
|
+
)
|
|
44
|
+
from .datetime_utc import ReplaceDatetimeUtcFromTimestamp, ReplaceDatetimeUtcNow
|
|
45
|
+
from .distutils_deprecations import FindDistutilsUsage
|
|
46
|
+
from .distutils_migrations import ReplaceDistutilsVersion
|
|
47
|
+
from .functools_deprecations import FindFunctoolsCmpToKey
|
|
48
|
+
from .gettext_deprecations import ReplaceGettextDeprecations
|
|
49
|
+
from .imp_migrations import FindImpUsage, ReplaceImpImport, ReplaceImpReload
|
|
50
|
+
from .inspect_deprecations import ReplaceInspectGetargspec
|
|
51
|
+
from .locale_deprecations import ReplaceLocaleResetlocale
|
|
52
|
+
from .logging_deprecations import ReplaceLoggingWarn
|
|
53
|
+
from .mailcap_migrations import FindMailcapModule
|
|
54
|
+
from .nntplib_migrations import FindNntplibModule
|
|
55
|
+
from .os_deprecations import FindOsPopen, FindOsSpawn
|
|
56
|
+
from .pathlib_deprecations import FindPathlibLinkTo
|
|
57
|
+
from .pipes_migrations import FindPipesModule
|
|
58
|
+
from .pkgutil_deprecations import ReplacePkgutilFindLoader, ReplacePkgutilGetLoader
|
|
59
|
+
from .removed_modules_312 import FindRemovedModules312
|
|
60
|
+
from .socket_deprecations import FindSocketGetFQDN
|
|
61
|
+
from .ssl_deprecations import FindSslMatchHostname
|
|
62
|
+
from .string_formatting import DetectPercentFormatting, DetectStrFormat
|
|
63
|
+
from .telnetlib_migrations import FindTelnetlibModule
|
|
64
|
+
from .tempfile_deprecations import FindTempfileMktemp
|
|
65
|
+
from .threading_deprecations import (
|
|
66
|
+
ReplaceConditionNotifyAll,
|
|
67
|
+
ReplaceThreadingActiveCount,
|
|
68
|
+
ReplaceThreadingCurrentThread,
|
|
69
|
+
)
|
|
70
|
+
from .typing_builtins import (
|
|
71
|
+
ReplaceTypingDictWithBuiltin,
|
|
72
|
+
ReplaceTypingFrozenSetWithBuiltin,
|
|
73
|
+
ReplaceTypingListWithBuiltin,
|
|
74
|
+
ReplaceTypingSetWithBuiltin,
|
|
75
|
+
ReplaceTypingTupleWithBuiltin,
|
|
76
|
+
ReplaceTypingTypeWithBuiltin,
|
|
77
|
+
)
|
|
78
|
+
from .typing_callable import ReplaceTypingCallableWithCollectionsAbcCallable
|
|
79
|
+
from .typing_union_to_pipe import (
|
|
80
|
+
ReplaceTypingOptionalWithUnion,
|
|
81
|
+
ReplaceTypingUnionWithPipe,
|
|
82
|
+
)
|
|
83
|
+
from .unittest_deprecations import ReplaceUnittestDeprecatedAliases
|
|
84
|
+
from .upgrade_to_python38 import UpgradeToPython38
|
|
85
|
+
from .upgrade_to_python39 import UpgradeToPython39
|
|
86
|
+
from .upgrade_to_python310 import UpgradeToPython310
|
|
87
|
+
from .upgrade_to_python311 import UpgradeToPython311
|
|
88
|
+
from .upgrade_to_python312 import UpgradeToPython312
|
|
89
|
+
from .upgrade_to_python313 import UpgradeToPython313
|
|
90
|
+
from .upgrade_to_python314 import UpgradeToPython314
|
|
91
|
+
from .urllib_deprecations import FindUrllibParseSplitFunctions, FindUrllibParseToBytes
|
|
92
|
+
from .uu_migrations import FindUuModule
|
|
93
|
+
from .xdrlib_migrations import FindXdrlibModule
|
|
94
|
+
from .xml_deprecations import FindElementGetchildren, ReplaceElementGetiterator
|
|
95
|
+
|
|
96
|
+
__all__ = [
|
|
97
|
+
# Detection/Find recipes
|
|
98
|
+
"DetectPercentFormatting",
|
|
99
|
+
"DetectStrFormat",
|
|
100
|
+
"FindAifcModule",
|
|
101
|
+
"FindAsyncioCoroutineDecorator",
|
|
102
|
+
"FindAudioopModule",
|
|
103
|
+
"FindCgiModule",
|
|
104
|
+
"FindCgitbModule",
|
|
105
|
+
"FindChunkModule",
|
|
106
|
+
"FindDistutilsUsage",
|
|
107
|
+
"FindElementGetchildren",
|
|
108
|
+
"FindFunctoolsCmpToKey",
|
|
109
|
+
"FindImghdrModule",
|
|
110
|
+
"FindImpUsage",
|
|
111
|
+
"FindMailcapModule",
|
|
112
|
+
"FindNntplibModule",
|
|
113
|
+
"FindOsPopen",
|
|
114
|
+
"FindOsSpawn",
|
|
115
|
+
"FindPathlibLinkTo",
|
|
116
|
+
"FindPipesModule",
|
|
117
|
+
"FindRemovedModules312",
|
|
118
|
+
"FindSndhdrModule",
|
|
119
|
+
"FindSocketGetFQDN",
|
|
120
|
+
"FindSslMatchHostname",
|
|
121
|
+
"FindSunauModule",
|
|
122
|
+
"FindTelnetlibModule",
|
|
123
|
+
"FindTempfileMktemp",
|
|
124
|
+
"FindUrllibParseSplitFunctions",
|
|
125
|
+
"FindUrllibParseToBytes",
|
|
126
|
+
"FindUuModule",
|
|
127
|
+
"FindXdrlibModule",
|
|
128
|
+
# Auto-fix: Array
|
|
129
|
+
"ReplaceArrayFromstring",
|
|
130
|
+
"ReplaceArrayTostring",
|
|
131
|
+
# Auto-fix: AST
|
|
132
|
+
"ReplaceAstBytes",
|
|
133
|
+
"ReplaceAstEllipsis",
|
|
134
|
+
"ReplaceAstNameConstant",
|
|
135
|
+
"ReplaceAstNum",
|
|
136
|
+
"ReplaceAstStr",
|
|
137
|
+
# Auto-fix: Asyncio
|
|
138
|
+
"MigrateAsyncioCoroutine",
|
|
139
|
+
# Auto-fix: Base64
|
|
140
|
+
"ReplaceBase64Decodestring",
|
|
141
|
+
"ReplaceBase64Encodestring",
|
|
142
|
+
# Auto-fix: Calendar
|
|
143
|
+
"ReplaceCalendarConstants",
|
|
144
|
+
# Auto-fix: CGI
|
|
145
|
+
"ReplaceCgiEscape",
|
|
146
|
+
# Auto-fix: Collections
|
|
147
|
+
"ReplaceCollectionsAbcImports",
|
|
148
|
+
# Auto-fix: Configparser
|
|
149
|
+
"ReplaceConfigparserReadfp",
|
|
150
|
+
"ReplaceConfigparserSafeConfigParser",
|
|
151
|
+
# Auto-fix: Datetime
|
|
152
|
+
"ReplaceDatetimeUtcFromTimestamp",
|
|
153
|
+
"ReplaceDatetimeUtcNow",
|
|
154
|
+
# Auto-fix: Distutils
|
|
155
|
+
"ReplaceDistutilsVersion",
|
|
156
|
+
# Auto-fix: Gettext
|
|
157
|
+
"ReplaceGettextDeprecations",
|
|
158
|
+
# Auto-fix: Imp -> Importlib
|
|
159
|
+
"ReplaceImpImport",
|
|
160
|
+
"ReplaceImpReload",
|
|
161
|
+
# Auto-fix: Inspect
|
|
162
|
+
"ReplaceInspectGetargspec",
|
|
163
|
+
# Auto-fix: Locale
|
|
164
|
+
"ReplaceLocaleResetlocale",
|
|
165
|
+
# Auto-fix: Logging
|
|
166
|
+
"ReplaceLoggingWarn",
|
|
167
|
+
# Auto-fix: Pkgutil
|
|
168
|
+
"ReplacePkgutilFindLoader",
|
|
169
|
+
"ReplacePkgutilGetLoader",
|
|
170
|
+
# Auto-fix: Threading
|
|
171
|
+
"ReplaceConditionNotifyAll",
|
|
172
|
+
"ReplaceThreadingActiveCount",
|
|
173
|
+
"ReplaceThreadingCurrentThread",
|
|
174
|
+
# Auto-fix: Typing -> Builtins (PEP 585)
|
|
175
|
+
"ReplaceTypingDictWithBuiltin",
|
|
176
|
+
"ReplaceTypingFrozenSetWithBuiltin",
|
|
177
|
+
"ReplaceTypingListWithBuiltin",
|
|
178
|
+
"ReplaceTypingSetWithBuiltin",
|
|
179
|
+
"ReplaceTypingTupleWithBuiltin",
|
|
180
|
+
"ReplaceTypingTypeWithBuiltin",
|
|
181
|
+
# Auto-fix: Typing
|
|
182
|
+
"ReplaceTypingCallableWithCollectionsAbcCallable",
|
|
183
|
+
"ReplaceTypingOptionalWithUnion",
|
|
184
|
+
"ReplaceTypingUnionWithPipe",
|
|
185
|
+
# Auto-fix: Unittest
|
|
186
|
+
"ReplaceUnittestDeprecatedAliases",
|
|
187
|
+
# Auto-fix: XML
|
|
188
|
+
"ReplaceElementGetiterator",
|
|
189
|
+
# Composite upgrade recipes
|
|
190
|
+
"UpgradeToPython38",
|
|
191
|
+
"UpgradeToPython39",
|
|
192
|
+
"UpgradeToPython310",
|
|
193
|
+
"UpgradeToPython311",
|
|
194
|
+
"UpgradeToPython312",
|
|
195
|
+
"UpgradeToPython313",
|
|
196
|
+
"UpgradeToPython314",
|
|
197
|
+
]
|