diff --git a/pyproject.toml b/pyproject.toml index 5b1895fdfe63..9f81d46f0b11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,12 +147,6 @@ extend-safe-fixes = [ "UP036", # Remove unnecessary `sys.version_info` blocks ] ignore = [ - ### - # TODO: Disabled temporarily, until Python 3.9 support is fully removed in - # May 2026. - ### - "UP035", # import from typing - "UP036", # Remove unnecessary `sys.version_info` blocks ### # Rules that can conflict with the formatter (Black) # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules @@ -238,6 +232,7 @@ ignore = [ "D", # pydocstyle # See comment on black's force-exclude config above "E501", # Line too long + "UP036", # Remove unnecessary `sys.version_info` blocks ] [tool.ruff.lint.pydocstyle] diff --git a/stdlib/_collections_abc.pyi b/stdlib/_collections_abc.pyi index d2499627d273..62e059da5916 100644 --- a/stdlib/_collections_abc.pyi +++ b/stdlib/_collections_abc.pyi @@ -1,7 +1,7 @@ import sys from abc import abstractmethod from types import MappingProxyType -from typing import ( # noqa: Y022,Y038,UP035,Y057,RUF100 +from typing import ( # noqa: Y022,Y038,UP035,Y057 AbstractSet as Set, AsyncGenerator as AsyncGenerator, AsyncIterable as AsyncIterable, diff --git a/stdlib/abc.pyi b/stdlib/abc.pyi index 1f7d25b735e6..2e8eff936c83 100644 --- a/stdlib/abc.pyi +++ b/stdlib/abc.pyi @@ -2,8 +2,8 @@ import _typeshed import sys from _typeshed import SupportsWrite from collections.abc import Callable -from typing import Any, Literal, ParamSpec, TypeVar -from typing_extensions import Concatenate, deprecated +from typing import Any, Concatenate, Literal, ParamSpec, TypeVar +from typing_extensions import deprecated _T = TypeVar("_T") _R_co = TypeVar("_R_co", covariant=True) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 0b87751437db..e518369ef230 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -37,11 +37,12 @@ from types import CellType, CodeType, EllipsisType, GenericAlias, NotImplemented # mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping} # are imported from collections.abc in builtins.pyi -from typing import ( # noqa: Y022,UP035,RUF100 +from typing import ( # noqa: Y022,UP035 IO, Any, BinaryIO, ClassVar, + Concatenate, Final, Generic, Mapping, @@ -64,16 +65,7 @@ from typing import ( # noqa: Y022,UP035,RUF100 ) # we can't import `Literal` from typing or mypy crashes: see #11247 -from typing_extensions import ( # noqa: Y023 - Concatenate, - Literal, - LiteralString, - Self, - TypeIs, - TypeVarTuple, - deprecated, - disjoint_base, -) +from typing_extensions import Literal, LiteralString, Self, TypeIs, TypeVarTuple, deprecated, disjoint_base # noqa: Y023, UP035 if sys.version_info >= (3, 14): from _typeshed import AnnotateFunc diff --git a/stdlib/curses/__init__.pyi b/stdlib/curses/__init__.pyi index 3abb2216708d..cf5048110878 100644 --- a/stdlib/curses/__init__.pyi +++ b/stdlib/curses/__init__.pyi @@ -2,8 +2,7 @@ from _curses import * from _curses import window as window from _typeshed import structseq from collections.abc import Callable -from typing import Final, ParamSpec, TypeVar, final, type_check_only -from typing_extensions import Concatenate +from typing import Concatenate, Final, ParamSpec, TypeVar, final, type_check_only # NOTE: The _curses module is ordinarily only available on Unix, but the # windows-curses package makes it available on Windows as well with the same diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 9fcdf9d8030a..db679983b02b 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -30,7 +30,7 @@ from collections.abc import ( from contextlib import AbstractAsyncContextManager as AsyncContextManager, AbstractContextManager as ContextManager from re import Match as Match, Pattern as Pattern from types import GenericAlias, ModuleType, UnionType -from typing import ( # noqa: Y022,Y037,Y038,Y039,UP035,RUF100 +from typing import ( # noqa: Y022,Y037,Y038,Y039,UP035 IO as IO, TYPE_CHECKING as TYPE_CHECKING, AbstractSet as AbstractSet, diff --git a/stubs/WebOb/webob/dec.pyi b/stubs/WebOb/webob/dec.pyi index 1f62705dc2b1..9fcee2a2ebda 100644 --- a/stubs/WebOb/webob/dec.pyi +++ b/stubs/WebOb/webob/dec.pyi @@ -1,7 +1,7 @@ from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment from collections.abc import Callable, Iterable, Mapping -from typing import Any, Generic, ParamSpec, TypeAlias, overload, type_check_only -from typing_extensions import Concatenate, Never, Self, TypeVar +from typing import Any, Concatenate, Generic, ParamSpec, TypeAlias, overload, type_check_only +from typing_extensions import Never, Self, TypeVar from webob.request import BaseRequest, Request from webob.response import Response diff --git a/stubs/seaborn/seaborn/_core/groupby.pyi b/stubs/seaborn/seaborn/_core/groupby.pyi index e29f4f051a2c..a07f2757c56b 100644 --- a/stubs/seaborn/seaborn/_core/groupby.pyi +++ b/stubs/seaborn/seaborn/_core/groupby.pyi @@ -1,7 +1,6 @@ from _typeshed import Incomplete from collections.abc import Callable, Hashable, Mapping -from typing import ParamSpec, TypeAlias -from typing_extensions import Concatenate +from typing import Concatenate, ParamSpec, TypeAlias from numpy import ufunc from pandas import DataFrame diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 0819e16f5474..3cc0dd8dabdc 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -1,8 +1,8 @@ import os from _typeshed import Incomplete from collections.abc import Callable, Generator, Iterable, Mapping -from typing import IO, Any, Literal, ParamSpec, TypeAlias, TypeVar -from typing_extensions import Concatenate, Self, deprecated +from typing import IO, Any, Concatenate, Literal, ParamSpec, TypeAlias, TypeVar +from typing_extensions import Self, deprecated import numpy as np from matplotlib.artist import Artist