From 21a8f84d52799e4018357b345e191791f6491b45 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:54:18 +0000 Subject: [PATCH 1/2] [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.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.9...v0.11.0) - [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..375622d5 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.0 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 01afca278a347e4ae24b3d84185ac2573e2a1e38 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:54:53 +0000 Subject: [PATCH 2/2] [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)