diff --git a/.flake8 b/.flake8 index 88c704d12..cf6578d7b 100644 --- a/.flake8 +++ b/.flake8 @@ -8,10 +8,6 @@ extend-ignore = Y090 per-file-ignores = # We should only need to noqa Y and F821 codes in .pyi files *.py: NQA - # Ignore Y052 in this file: there are loads of false positives - # due to the fact that flake8-pyi doesn't understand subclasses of `CoerciveEnum` - # as being enum classes - stubs/fpdf2/fpdf/enums.pyi: Y052 # Generated protobuf files: # Y021: Include docstrings # Y023: Alias typing as typing_extensions diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ffa38162..e94af2810 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - id: flake8 additional_dependencies: - "flake8-noqa==1.4.0" # must match requirements-tests.txt - - "flake8-pyi==24.4.1" # must match requirements-tests.txt + - "flake8-pyi==24.6.0" # must match requirements-tests.txt types: [file] types_or: [python, pyi] - repo: meta diff --git a/requirements-tests.txt b/requirements-tests.txt index ec9c2e40c..6bdf6664c 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -4,7 +4,7 @@ black==24.3.0 # must match .pre-commit-config.yaml flake8==7.0.0 # must match .pre-commit-config.yaml flake8-noqa==1.4.0 # must match .pre-commit-config.yaml -flake8-pyi==24.4.1 # must match .pre-commit-config.yaml +flake8-pyi==24.6.0 # must match .pre-commit-config.yaml mypy==1.10.0 pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml pyright==1.1.366 diff --git a/stdlib/_ast.pyi b/stdlib/_ast.pyi index 4d4ffbbd0..d14c6d39a 100644 --- a/stdlib/_ast.pyi +++ b/stdlib/_ast.pyi @@ -11,7 +11,7 @@ if sys.version_info >= (3, 13): PyCF_OPTIMIZED_AST: Literal[33792] # Used for node end positions in constructor keyword arguments -_EndPositionT = typing_extensions.TypeVar("_EndPositionT", int, int | None, default=int | None) # noqa: Y023 +_EndPositionT = typing_extensions.TypeVar("_EndPositionT", int, int | None, default=int | None) # Alias used for fields that must always be valid identifiers # A string `x` counts as a valid identifier if both the following are True diff --git a/stubs/shapely/shapely/_geometry.pyi b/stubs/shapely/shapely/_geometry.pyi index 5f1833533..874dc42ab 100644 --- a/stubs/shapely/shapely/_geometry.pyi +++ b/stubs/shapely/shapely/_geometry.pyi @@ -162,9 +162,9 @@ def get_precision(geometry: Geometry | None, **kwargs) -> float: ... def get_precision(geometry: OptGeoArrayLikeSeq, **kwargs) -> NDArray[np.float64]: ... class SetPrecisionMode(ParamEnum): - valid_output = 0 # noqa: Y052 - pointwise = 1 # noqa: Y052 - keep_collapsed = 2 # noqa: Y052 + valid_output = 0 + pointwise = 1 + keep_collapsed = 2 @overload def set_precision(geometry: OptGeoT, grid_size: float, mode: _PrecisionMode = "valid_output", **kwargs) -> OptGeoT: ... diff --git a/stubs/shapely/shapely/constructive.pyi b/stubs/shapely/shapely/constructive.pyi index 55ceab3c7..f022b0cd7 100644 --- a/stubs/shapely/shapely/constructive.pyi +++ b/stubs/shapely/shapely/constructive.pyi @@ -39,14 +39,14 @@ __all__ = [ ] class BufferCapStyle(ParamEnum): - round = 1 # noqa: Y052 - flat = 2 # noqa: Y052 - square = 3 # noqa: Y052 + round = 1 + flat = 2 + square = 3 class BufferJoinStyle(ParamEnum): - round = 1 # noqa: Y052 - mitre = 2 # noqa: Y052 - bevel = 3 # noqa: Y052 + round = 1 + mitre = 2 + bevel = 3 @overload def boundary(geometry: Point | MultiPoint, **kwargs) -> GeometryCollection: ... diff --git a/stubs/shapely/shapely/geometry/base.pyi b/stubs/shapely/shapely/geometry/base.pyi index fe0da8aa5..05caa6632 100644 --- a/stubs/shapely/shapely/geometry/base.pyi +++ b/stubs/shapely/shapely/geometry/base.pyi @@ -1,7 +1,7 @@ from array import array from collections.abc import Iterator from typing import Any, Generic, Literal, NoReturn, overload -from typing_extensions import Self, TypeVar, deprecated # noqa: Y023 +from typing_extensions import Self, TypeVar, deprecated import numpy as np from numpy.typing import NDArray diff --git a/stubs/shapely/shapely/io.pyi b/stubs/shapely/shapely/io.pyi index f7e1d2e85..27b667e53 100644 --- a/stubs/shapely/shapely/io.pyi +++ b/stubs/shapely/shapely/io.pyi @@ -18,8 +18,8 @@ __all__ = ["from_geojson", "from_ragged_array", "from_wkb", "from_wkt", "to_geoj DecodingErrorOptions: Incomplete class WKBFlavorOptions(ParamEnum): - extended = 1 # noqa: Y052 - iso = 2 # noqa: Y052 + extended = 1 + iso = 2 @overload def to_wkt( diff --git a/stubs/shapely/shapely/strtree.pyi b/stubs/shapely/shapely/strtree.pyi index d43291c78..d85da2e73 100644 --- a/stubs/shapely/shapely/strtree.pyi +++ b/stubs/shapely/shapely/strtree.pyi @@ -15,15 +15,15 @@ _BinaryPredicate: TypeAlias = Literal[ ] class BinaryPredicate(ParamEnum): - intersects = 1 # noqa: Y052 - within = 2 # noqa: Y052 - contains = 3 # noqa: Y052 - overlaps = 4 # noqa: Y052 - crosses = 5 # noqa: Y052 - touches = 6 # noqa: Y052 - covers = 7 # noqa: Y052 - covered_by = 8 # noqa: Y052 - contains_properly = 9 # noqa: Y052 + intersects = 1 + within = 2 + contains = 3 + overlaps = 4 + crosses = 5 + touches = 6 + covers = 7 + covered_by = 8 + contains_properly = 9 class STRtree: def __init__(self, geoms: GeoArrayLikeSeq, node_capacity: SupportsIndex = 10) -> None: ...