Skip to content

Commit

Permalink
Merge pull request #902 from asottile/py312-release
Browse files Browse the repository at this point in the history
update import symbols for 3.12 release
  • Loading branch information
asottile authored Oct 2, 2023
2 parents ffb735b + f053b50 commit 97e87dc
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pyupgrade/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ def main(argv: Sequence[str] | None = None) -> int:
'--py311-plus',
action='store_const', dest='min_version', const=(3, 11),
)
parser.add_argument(
'--py312-plus',
action='store_const', dest='min_version', const=(3, 12),
)
args = parser.parse_args(argv)

ret = 0
Expand Down
54 changes: 53 additions & 1 deletion pyupgrade/_plugins/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from pyupgrade._token_helpers import indented_amount

# GENERATED VIA generate-imports
# Using reorder-python-imports==3.11.0
# Using reorder-python-imports==3.12.0
REMOVALS = {
(3,): {
'__future__': {
Expand Down Expand Up @@ -89,16 +89,52 @@
('six.moves.urllib', 'robotparser'): 'urllib',
},
(3, 6): {
('typing_extensions', 'AbstractSet'): 'typing',
('typing_extensions', 'AnyStr'): 'typing',
('typing_extensions', 'AsyncIterable'): 'typing',
('typing_extensions', 'AsyncIterator'): 'typing',
('typing_extensions', 'Awaitable'): 'typing',
('typing_extensions', 'BinaryIO'): 'typing',
('typing_extensions', 'Callable'): 'typing',
('typing_extensions', 'ClassVar'): 'typing',
('typing_extensions', 'Collection'): 'typing',
('typing_extensions', 'Container'): 'typing',
('typing_extensions', 'ContextManager'): 'typing',
('typing_extensions', 'Coroutine'): 'typing',
('typing_extensions', 'DefaultDict'): 'typing',
('typing_extensions', 'Dict'): 'typing',
('typing_extensions', 'FrozenSet'): 'typing',
('typing_extensions', 'Generator'): 'typing',
('typing_extensions', 'Generic'): 'typing',
('typing_extensions', 'Hashable'): 'typing',
('typing_extensions', 'IO'): 'typing',
('typing_extensions', 'ItemsView'): 'typing',
('typing_extensions', 'Iterable'): 'typing',
('typing_extensions', 'Iterator'): 'typing',
('typing_extensions', 'KeysView'): 'typing',
('typing_extensions', 'List'): 'typing',
('typing_extensions', 'Mapping'): 'typing',
('typing_extensions', 'MappingView'): 'typing',
('typing_extensions', 'Match'): 'typing',
('typing_extensions', 'MutableMapping'): 'typing',
('typing_extensions', 'MutableSequence'): 'typing',
('typing_extensions', 'MutableSet'): 'typing',
('typing_extensions', 'Optional'): 'typing',
('typing_extensions', 'Pattern'): 'typing',
('typing_extensions', 'Reversible'): 'typing',
('typing_extensions', 'Sequence'): 'typing',
('typing_extensions', 'Set'): 'typing',
('typing_extensions', 'Sized'): 'typing',
('typing_extensions', 'TYPE_CHECKING'): 'typing',
('typing_extensions', 'Text'): 'typing',
('typing_extensions', 'TextIO'): 'typing',
('typing_extensions', 'Tuple'): 'typing',
('typing_extensions', 'Type'): 'typing',
('typing_extensions', 'Union'): 'typing',
('typing_extensions', 'ValuesView'): 'typing',
('typing_extensions', 'cast'): 'typing',
('typing_extensions', 'no_type_check'): 'typing',
('typing_extensions', 'no_type_check_decorator'): 'typing',
},
(3, 7): {
('mypy_extensions', 'NoReturn'): 'typing',
Expand All @@ -107,6 +143,7 @@
('typing_extensions', 'ChainMap'): 'typing',
('typing_extensions', 'Counter'): 'typing',
('typing_extensions', 'Deque'): 'typing',
('typing_extensions', 'ForwardRef'): 'typing',
('typing_extensions', 'NoReturn'): 'typing',
},
(3, 8): {
Expand Down Expand Up @@ -178,6 +215,21 @@
('typing_extensions', 'overload'): 'typing',
('typing_extensions', 'reveal_type'): 'typing',
},
(3, 12): {
('typing_extensions', 'NamedTuple'): 'typing',
('typing_extensions', 'Protocol'): 'typing',
('typing_extensions', 'SupportsAbs'): 'typing',
('typing_extensions', 'SupportsBytes'): 'typing',
('typing_extensions', 'SupportsComplex'): 'typing',
('typing_extensions', 'SupportsFloat'): 'typing',
('typing_extensions', 'SupportsInt'): 'typing',
('typing_extensions', 'SupportsRound'): 'typing',
('typing_extensions', 'TypeAliasType'): 'typing',
('typing_extensions', 'TypedDict'): 'typing',
('typing_extensions', 'Unpack'): 'typing',
('typing_extensions', 'dataclass_transform'): 'typing',
('typing_extensions', 'override'): 'typing',
},
}
REPLACE_MODS = {
'six.moves.BaseHTTPServer': 'http.server',
Expand Down

0 comments on commit 97e87dc

Please sign in to comment.