-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark some
deprecated-import
fixes as unsafe.
- Loading branch information
Showing
22 changed files
with
3,959 additions
and
20 deletions.
There are no files selected for viewing
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""Things that were moved from `collections` to `collections.abc`.""" | ||
|
||
from collections import ( | ||
AsyncGenerator, | ||
AsyncIterable, | ||
AsyncIterator, | ||
Awaitable, | ||
ByteString, | ||
Callable, | ||
Collection, | ||
Container, | ||
Coroutine, | ||
Generator, | ||
Hashable, | ||
ItemsView, | ||
Iterable, | ||
Iterator, | ||
KeysView, | ||
Mapping, | ||
MappingView, | ||
MutableMapping, | ||
MutableSequence, | ||
MutableSet, | ||
Reversible, | ||
Sequence, | ||
Set, | ||
Sized, | ||
ValuesView, | ||
) |
98 changes: 98 additions & 0 deletions
98
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
"""Things that were moved from `typing_extensions` to `typing`.""" | ||
from typing_extensions import AbstractSet | ||
from typing_extensions import AnyStr | ||
from typing_extensions import AsyncIterable | ||
from typing_extensions import AsyncIterator | ||
from typing_extensions import Awaitable | ||
from typing_extensions import BinaryIO | ||
from typing_extensions import Callable | ||
from typing_extensions import ClassVar | ||
from typing_extensions import Collection | ||
from typing_extensions import Container | ||
from typing_extensions import ContextManager | ||
from typing_extensions import Coroutine | ||
from typing_extensions import DefaultDict | ||
from typing_extensions import Dict | ||
from typing_extensions import FrozenSet | ||
from typing_extensions import Generator | ||
from typing_extensions import Generic | ||
from typing_extensions import Hashable | ||
from typing_extensions import IO | ||
from typing_extensions import ItemsView | ||
from typing_extensions import Iterable | ||
from typing_extensions import KeysView | ||
from typing_extensions import List | ||
from typing_extensions import Mapping | ||
from typing_extensions import MappingView | ||
from typing_extensions import Match | ||
from typing_extensions import MutableMapping | ||
from typing_extensions import MutableSequence | ||
from typing_extensions import MutableSet | ||
from typing_extensions import Optional | ||
from typing_extensions import Pattern | ||
from typing_extensions import Reversible | ||
from typing_extensions import Sequence | ||
from typing_extensions import Set | ||
from typing_extensions import Sized | ||
from typing_extensions import TYPE_CHECKING | ||
from typing_extensions import Text | ||
from typing_extensions import TextIO | ||
from typing_extensions import Tuple | ||
from typing_extensions import Type | ||
from typing_extensions import Union | ||
from typing_extensions import ValuesView | ||
from typing_extensions import cast | ||
from typing_extensions import no_type_check | ||
from typing_extensions import no_type_check_decorator | ||
|
||
from typing_extensions import AsyncContextManager | ||
from typing_extensions import AsyncGenerator | ||
from typing_extensions import ChainMap | ||
from typing_extensions import Counter | ||
from typing_extensions import Deque | ||
from typing_extensions import ForwardRef | ||
from typing_extensions import NoReturn | ||
|
||
from typing_extensions import Final | ||
from typing_extensions import OrderedDict | ||
from typing_extensions import runtime_checkable | ||
|
||
from typing_extensions import Annotated | ||
from typing_extensions import get_type_hints | ||
|
||
from typing_extensions import Concatenate | ||
from typing_extensions import Literal | ||
from typing_extensions import NewType | ||
from typing_extensions import ParamSpecArgs | ||
from typing_extensions import ParamSpecKwargs | ||
from typing_extensions import TypeAlias | ||
from typing_extensions import TypeGuard | ||
from typing_extensions import get_args | ||
from typing_extensions import get_origin | ||
from typing_extensions import is_typeddict | ||
|
||
from typing_extensions import Any | ||
from typing_extensions import LiteralString | ||
from typing_extensions import Never | ||
from typing_extensions import NotRequired | ||
from typing_extensions import Required | ||
from typing_extensions import Self | ||
from typing_extensions import assert_never | ||
from typing_extensions import assert_type | ||
from typing_extensions import clear_overloads | ||
from typing_extensions import final | ||
from typing_extensions import get_overloads | ||
from typing_extensions import overload | ||
from typing_extensions import reveal_type | ||
|
||
from typing_extensions import Protocol | ||
from typing_extensions import SupportsAbs | ||
from typing_extensions import SupportsBytes | ||
from typing_extensions import SupportsComplex | ||
from typing_extensions import SupportsFloat | ||
from typing_extensions import SupportsInt | ||
from typing_extensions import SupportsRound | ||
from typing_extensions import Unpack | ||
from typing_extensions import dataclass_transform | ||
from typing_extensions import NamedTuple | ||
from typing_extensions import TypedDict |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_3.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"""Things moved from `pipes` to `shlex`.""" | ||
from pipes import quote |
4 changes: 4 additions & 0 deletions
4
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_4.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"""Things moved from `mypy_extensions` to `typing`.""" | ||
from mypy_extensions import NoReturn | ||
|
||
from mypy_extensions import TypedDict |
26 changes: 26 additions & 0 deletions
26
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_5.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Members of `typing` that were moved to `collections.abc`.""" | ||
from typing import AsyncGenerator | ||
from typing import AsyncIterable | ||
from typing import AsyncIterator | ||
from typing import Awaitable | ||
from typing import ByteString | ||
from typing import Collection | ||
from typing import Container | ||
from typing import Coroutine | ||
from typing import Generator | ||
from typing import Hashable | ||
from typing import ItemsView | ||
from typing import Iterable | ||
from typing import Iterator | ||
from typing import KeysView | ||
from typing import Mapping | ||
from typing import MappingView | ||
from typing import MutableMapping | ||
from typing import MutableSequence | ||
from typing import MutableSet | ||
from typing import Reversible | ||
from typing import Sequence | ||
from typing import Sized | ||
from typing import ValuesView | ||
|
||
from typing import Callable |
4 changes: 4 additions & 0 deletions
4
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_6.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"""Members of `typing` that were moved to `collections`.""" | ||
from typing import ChainMap | ||
from typing import Counter | ||
from typing import OrderedDict |
3 changes: 3 additions & 0 deletions
3
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_7.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""Members of `typing` that were moved to `typing.re`.""" | ||
from typing import Match | ||
from typing import Pattern |
3 changes: 3 additions & 0 deletions
3
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_8.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""Members of `typing.re` that were moved to `re`.""" | ||
from typing.re import Match | ||
from typing.re import Pattern |
2 changes: 2 additions & 0 deletions
2
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP035_9.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"""Members of `backports.strenum` that were moved to `enum`.""" | ||
from backports.strenum import StrEnum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.