Skip to content

Commit d1198ba

Browse files
authored
Reenable ruff rules UP035, UP036, remove RUF100 (#15715)
1 parent 60dc8f5 commit d1198ba

9 files changed

Lines changed: 14 additions & 29 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ extend-safe-fixes = [
147147
"UP036", # Remove unnecessary `sys.version_info` blocks
148148
]
149149
ignore = [
150-
###
151-
# TODO: Disabled temporarily, until Python 3.9 support is fully removed in
152-
# May 2026.
153-
###
154-
"UP035", # import from typing
155-
"UP036", # Remove unnecessary `sys.version_info` blocks
156150
###
157151
# Rules that can conflict with the formatter (Black)
158152
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
@@ -238,6 +232,7 @@ ignore = [
238232
"D", # pydocstyle
239233
# See comment on black's force-exclude config above
240234
"E501", # Line too long
235+
"UP036", # Remove unnecessary `sys.version_info` blocks
241236
]
242237

243238
[tool.ruff.lint.pydocstyle]

stdlib/_collections_abc.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from abc import abstractmethod
33
from types import MappingProxyType
4-
from typing import ( # noqa: Y022,Y038,UP035,Y057,RUF100
4+
from typing import ( # noqa: Y022,Y038,UP035,Y057
55
AbstractSet as Set,
66
AsyncGenerator as AsyncGenerator,
77
AsyncIterable as AsyncIterable,

stdlib/abc.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import _typeshed
22
import sys
33
from _typeshed import SupportsWrite
44
from collections.abc import Callable
5-
from typing import Any, Literal, ParamSpec, TypeVar
6-
from typing_extensions import Concatenate, deprecated
5+
from typing import Any, Concatenate, Literal, ParamSpec, TypeVar
6+
from typing_extensions import deprecated
77

88
_T = TypeVar("_T")
99
_R_co = TypeVar("_R_co", covariant=True)

stdlib/builtins.pyi

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ from types import CellType, CodeType, EllipsisType, GenericAlias, NotImplemented
3737

3838
# mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping}
3939
# are imported from collections.abc in builtins.pyi
40-
from typing import ( # noqa: Y022,UP035,RUF100
40+
from typing import ( # noqa: Y022,UP035
4141
IO,
4242
Any,
4343
BinaryIO,
4444
ClassVar,
45+
Concatenate,
4546
Final,
4647
Generic,
4748
Mapping,
@@ -64,16 +65,7 @@ from typing import ( # noqa: Y022,UP035,RUF100
6465
)
6566

6667
# we can't import `Literal` from typing or mypy crashes: see #11247
67-
from typing_extensions import ( # noqa: Y023
68-
Concatenate,
69-
Literal,
70-
LiteralString,
71-
Self,
72-
TypeIs,
73-
TypeVarTuple,
74-
deprecated,
75-
disjoint_base,
76-
)
68+
from typing_extensions import Literal, LiteralString, Self, TypeIs, TypeVarTuple, deprecated, disjoint_base # noqa: Y023, UP035
7769

7870
if sys.version_info >= (3, 14):
7971
from _typeshed import AnnotateFunc

stdlib/curses/__init__.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ from _curses import *
22
from _curses import window as window
33
from _typeshed import structseq
44
from collections.abc import Callable
5-
from typing import Final, ParamSpec, TypeVar, final, type_check_only
6-
from typing_extensions import Concatenate
5+
from typing import Concatenate, Final, ParamSpec, TypeVar, final, type_check_only
76

87
# NOTE: The _curses module is ordinarily only available on Unix, but the
98
# windows-curses package makes it available on Windows as well with the same

stdlib/typing_extensions.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ from collections.abc import (
3030
from contextlib import AbstractAsyncContextManager as AsyncContextManager, AbstractContextManager as ContextManager
3131
from re import Match as Match, Pattern as Pattern
3232
from types import GenericAlias, ModuleType, UnionType
33-
from typing import ( # noqa: Y022,Y037,Y038,Y039,UP035,RUF100
33+
from typing import ( # noqa: Y022,Y037,Y038,Y039,UP035
3434
IO as IO,
3535
TYPE_CHECKING as TYPE_CHECKING,
3636
AbstractSet as AbstractSet,

stubs/WebOb/webob/dec.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
22
from collections.abc import Callable, Iterable, Mapping
3-
from typing import Any, Generic, ParamSpec, TypeAlias, overload, type_check_only
4-
from typing_extensions import Concatenate, Never, Self, TypeVar
3+
from typing import Any, Concatenate, Generic, ParamSpec, TypeAlias, overload, type_check_only
4+
from typing_extensions import Never, Self, TypeVar
55

66
from webob.request import BaseRequest, Request
77
from webob.response import Response

stubs/seaborn/seaborn/_core/groupby.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from _typeshed import Incomplete
22
from collections.abc import Callable, Hashable, Mapping
3-
from typing import ParamSpec, TypeAlias
4-
from typing_extensions import Concatenate
3+
from typing import Concatenate, ParamSpec, TypeAlias
54

65
from numpy import ufunc
76
from pandas import DataFrame

stubs/seaborn/seaborn/axisgrid.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import os
22
from _typeshed import Incomplete
33
from collections.abc import Callable, Generator, Iterable, Mapping
4-
from typing import IO, Any, Literal, ParamSpec, TypeAlias, TypeVar
5-
from typing_extensions import Concatenate, Self, deprecated
4+
from typing import IO, Any, Concatenate, Literal, ParamSpec, TypeAlias, TypeVar
5+
from typing_extensions import Self, deprecated
66

77
import numpy as np
88
from matplotlib.artist import Artist

0 commit comments

Comments
 (0)