diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3733c84f6b76..3fd5f92b96ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: additional_dependencies: ["json5==0.15.0"] - repo: https://github.com/astral-sh/ruff-pre-commit # The Ruff version must match requirements-tests.txt. - rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20 + rev: 2eeb5678de71a00c0902cbda7105d328432f72cb # frozen: v0.16.8 hooks: - id: ruff name: Run ruff on stubs, tests and scripts diff --git a/pyproject.toml b/pyproject.toml index c3a4fe66b780..bc78b2485265 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -197,6 +197,7 @@ ignore = [ "PLR5501", # Use `elif` instead of `else` then `if`, to reduce indentation # Often just leads to redundant more verbose code when needing an actual str "PTH208", # Use `pathlib.Path.iterdir()` instead. + "RUF036", # `None` is not at the end of the union # Allow FIXME "TD001", # Invalid TODO tag: `{tag}` # Git blame is sufficient diff --git a/requirements-tests.txt b/requirements-tests.txt index 35432cd35afd..2f6af8d04b14 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -12,7 +12,7 @@ mypy-protobuf==5.1.0; python_version < "3.15" packaging==26.2 pathspec>=1.1.1 pre-commit -ruff==0.15.20 +ruff==0.16.8 # Required by create_baseline_stubs.py. # stubdefaulter depends on libcst, which does not yet install cleanly on Python 3.15. stubdefaulter==0.1.0; python_version < "3.15" diff --git a/stubs/reportlab/reportlab/lib/rltempfile.pyi b/stubs/reportlab/reportlab/lib/rltempfile.pyi index 24b270ff237c..82979cda9478 100644 --- a/stubs/reportlab/reportlab/lib/rltempfile.pyi +++ b/stubs/reportlab/reportlab/lib/rltempfile.pyi @@ -1,4 +1,5 @@ def get_rl_tempdir(*subdirs: str) -> str: ... def get_rl_tempfile(fn: str | None = None) -> str: ... -__all__ = ("get_rl_tempdir", "get_rl_tempdir") +# The duplicate entry matches the runtime __all__. +__all__ = ("get_rl_tempdir", "get_rl_tempdir") # noqa: RUF068 diff --git a/stubs/workalendar/workalendar/europe/__init__.pyi b/stubs/workalendar/workalendar/europe/__init__.pyi index b6abc88df1dc..afaccb646847 100644 --- a/stubs/workalendar/workalendar/europe/__init__.pyi +++ b/stubs/workalendar/workalendar/europe/__init__.pyi @@ -249,7 +249,8 @@ __all__ = ( "Cantabria", "ValencianCommunity", # Switzerland - "Switzerland", + # The duplicate entry matches the runtime __all__. + "Switzerland", # noqa: RUF068 "Aargau", "AppenzellInnerrhoden", "AppenzellAusserrhoden",