From 8e3c2096861158b945556935000df47c7edb060b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:00:29 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.11.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.9...v0.11.4) - [github.com/crate-ci/typos: v1.30.0 → v1](https://github.com/crate-ci/typos/compare/v1.30.0...v1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dbec99bc..778bb529 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: python-no-log-warn - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.9 + rev: v0.11.4 hooks: - id: ruff-format - id: ruff @@ -59,7 +59,7 @@ repos: - id: nbstripout exclude: (docs) - repo: https://github.com/crate-ci/typos - rev: v1.30.0 + rev: v1 hooks: - id: typos exclude: (\.ipynb) From ff72cb4ab494fc54ffdce008fdfe60305ffe4dc6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:01:32 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytask/logging.py | 2 +- src/_pytask/profile.py | 2 +- src/_pytask/traceback.py | 2 +- src/_pytask/typing.py | 2 +- src/_pytask/warnings.py | 2 +- src/_pytask/warnings_utils.py | 2 +- tests/test_console.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/_pytask/logging.py b/src/_pytask/logging.py index 4cc343a2..46276f5e 100644 --- a/src/_pytask/logging.py +++ b/src/_pytask/logging.py @@ -1,4 +1,4 @@ -"""Add general logging capabilities.""" # noqa: A005 +"""Add general logging capabilities.""" from __future__ import annotations diff --git a/src/_pytask/profile.py b/src/_pytask/profile.py index 000a55b4..b34ef045 100644 --- a/src/_pytask/profile.py +++ b/src/_pytask/profile.py @@ -1,4 +1,4 @@ -"""Contains the code to profile the execution.""" # noqa: A005 +"""Contains the code to profile the execution.""" from __future__ import annotations diff --git a/src/_pytask/traceback.py b/src/_pytask/traceback.py index 71833ed9..d2b13222 100644 --- a/src/_pytask/traceback.py +++ b/src/_pytask/traceback.py @@ -1,4 +1,4 @@ -"""Process tracebacks.""" # noqa: A005 +"""Process tracebacks.""" from __future__ import annotations diff --git a/src/_pytask/typing.py b/src/_pytask/typing.py index eac5854d..f2ddba9b 100644 --- a/src/_pytask/typing.py +++ b/src/_pytask/typing.py @@ -1,4 +1,4 @@ -from __future__ import annotations # noqa: A005 +from __future__ import annotations import functools from enum import Enum diff --git a/src/_pytask/warnings.py b/src/_pytask/warnings.py index 0c307683..3b2325e8 100644 --- a/src/_pytask/warnings.py +++ b/src/_pytask/warnings.py @@ -1,4 +1,4 @@ -"""Contains code for capturing warnings.""" # noqa: A005 +"""Contains code for capturing warnings.""" from __future__ import annotations diff --git a/src/_pytask/warnings_utils.py b/src/_pytask/warnings_utils.py index 89a0b1e6..eb198f62 100644 --- a/src/_pytask/warnings_utils.py +++ b/src/_pytask/warnings_utils.py @@ -129,7 +129,7 @@ def _resolve_warning_category(category: str) -> type[Warning]: if not issubclass(cat, Warning): msg = f"{cat} is not a Warning subclass" raise TypeError(msg) - return cast(type[Warning], cat) + return cast("type[Warning]", cat) def warning_record_to_str(warning_message: warnings.WarningMessage) -> str: diff --git a/tests/test_console.py b/tests/test_console.py index 6aa74193..f9cd682a 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -80,7 +80,7 @@ def test_create_url_style_for_path(edtior_url_scheme, expected): + [(outcome, CollectionOutcome, "description") for outcome in CollectionOutcome], ) def test_create_summary_panel(capsys, outcome, outcome_enum, total_description): - counts = {out: 0 for out in outcome_enum} + counts = dict.fromkeys(outcome_enum, 0) counts[outcome] = 1 panel = create_summary_panel(counts, outcome_enum, total_description) console.print(panel) From 5463aaf4aefa283f316302d7c75669263e4b8aa3 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Sun, 13 Apr 2025 16:32:22 +0200 Subject: [PATCH 3/3] FIx. --- .pre-commit-config.yaml | 4 ++-- src/_pytask/profile.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 778bb529..140da688 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: python-no-log-warn - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.4 + rev: v0.11.5 hooks: - id: ruff-format - id: ruff @@ -59,7 +59,7 @@ repos: - id: nbstripout exclude: (docs) - repo: https://github.com/crate-ci/typos - rev: v1 + rev: v1.31.1 hooks: - id: typos exclude: (\.ipynb) diff --git a/src/_pytask/profile.py b/src/_pytask/profile.py index b34ef045..8785c840 100644 --- a/src/_pytask/profile.py +++ b/src/_pytask/profile.py @@ -148,7 +148,7 @@ def profile(**raw_config: Any) -> NoReturn: except CollectionError: # pragma: no cover session.exit_code = ExitCode.COLLECTION_FAILED - except Exception: # noqa: BLE001; pragma: no cover + except Exception: # noqa: BLE001 pragma: no cover session.exit_code = ExitCode.FAILED console.print_exception() console.rule(style="failed")