From dfc97c4b3455a8a499b1807d35f873aa7d06c06e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 22:09:00 +0000 Subject: [PATCH 1/4] build(deps-dev): bump `mypy` from 1.16.1 to 1.17.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 22d33246e..042d063db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,7 @@ dev = [ "ruff == 0.6.1" ] mypy = [ - "mypy == 1.16.1", + "mypy == 1.17.0", "types-Deprecated ~= 1.2", "types-requests ~= 2.32.0", "types-pyyaml ~= 6.0", From 11b2cd3c3ae592747d096cc1f80513530f496a1c Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 27 Jul 2025 00:32:02 -0600 Subject: [PATCH 2/4] chore(pre-commit): bump `mypy` plugin from 1.16.1 to 1.17.0 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ae875b90..0127d653a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,7 +50,7 @@ repos: name: ruff (format) - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.16.1" + rev: "v1.17.0" hooks: - id: mypy additional_dependencies: From 089fb4bcdb11636ce2b34c481d638e0149da2e49 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 27 Jul 2025 12:46:38 -0600 Subject: [PATCH 3/4] refactor: update type definitions --- src/semantic_release/commit_parser/_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/semantic_release/commit_parser/_base.py b/src/semantic_release/commit_parser/_base.py index a144e0945..aee4f107e 100644 --- a/src/semantic_release/commit_parser/_base.py +++ b/src/semantic_release/commit_parser/_base.py @@ -1,7 +1,7 @@ from __future__ import annotations from abc import ABC, abstractmethod -from typing import TYPE_CHECKING, Any, Generic, TypeVar +from typing import TYPE_CHECKING, Any, Dict, Generic, TypeVar, Union from semantic_release.commit_parser.token import ParseResultType @@ -9,7 +9,7 @@ from git.objects.commit import Commit -class ParserOptions(dict): +class ParserOptions(Dict[Union[str, int, float], Any]): """ ParserOptions should accept the keyword arguments they are interested in from configuration and process them as desired, ultimately creating attributes From b2b2a54cdcff2be5a585c338adcd0d5ebc0b5a9e Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Tue, 5 Aug 2025 00:20:19 -0600 Subject: [PATCH 4/4] style(utils): fix mypy errors & unnecessary imports --- src/semantic_release/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/semantic_release/helpers.py b/src/semantic_release/helpers.py index c50369575..f6bae05ea 100644 --- a/src/semantic_release/helpers.py +++ b/src/semantic_release/helpers.py @@ -8,7 +8,7 @@ from functools import lru_cache, reduce, wraps from pathlib import Path, PurePosixPath from re import IGNORECASE, compile as regexp -from typing import TYPE_CHECKING, Any, Callable, NamedTuple, Sequence, TypeVar +from typing import TYPE_CHECKING, Callable, NamedTuple, TypeVar from urllib.parse import urlsplit from semantic_release.globals import logger @@ -16,7 +16,7 @@ if TYPE_CHECKING: # pragma: no cover from logging import Logger from re import Pattern - from typing import Iterable + from typing import Any, Iterable, Sequence number_pattern = regexp(r"(?P\S*?)(?P\d[\d,]*)\b") @@ -94,7 +94,7 @@ def text_reducer(text: str, filter_pair: tuple[Pattern[str], str]) -> str: def validate_types_in_sequence( - sequence: Sequence, types: type | tuple[type, ...] + sequence: Sequence[Any], types: type | tuple[type, ...] ) -> bool: """Validate that all elements in a sequence are of a specific type""" return all(isinstance(item, types) for item in sequence)