From fd8de6718cff3ce7b0f0c5a65087bc047842078f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 09:48:42 +0000 Subject: [PATCH 1/2] build(deps-dev): bump typeguard from 2.13.3 to 4.5.1 Bumps [typeguard](https://github.com/agronholm/typeguard) from 2.13.3 to 4.5.1. - [Release notes](https://github.com/agronholm/typeguard/releases) - [Commits](https://github.com/agronholm/typeguard/compare/2.13.3...4.5.1) --- updated-dependencies: - dependency-name: typeguard dependency-version: 4.5.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- uv.lock | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2780a74..0d441b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ test = [ "ruff", "pytest-cov", "ty", - "typeguard>=2.13.3,<3", + "typeguard>=2.13.3,<5", "pre-commit", ] docs = [ diff --git a/uv.lock b/uv.lock index 8b213c3..99c33ed 100644 --- a/uv.lock +++ b/uv.lock @@ -592,7 +592,7 @@ test = [ { name = "pytest-cov" }, { name = "ruff" }, { name = "ty" }, - { name = "typeguard", specifier = ">=2.13.3,<3" }, + { name = "typeguard", specifier = ">=2.13.3,<5" }, ] [[package]] @@ -1376,11 +1376,14 @@ wheels = [ [[package]] name = "typeguard" -version = "2.13.3" +version = "4.5.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3a/38/c61bfcf62a7b572b5e9363a802ff92559cb427ee963048e1442e3aef7490/typeguard-2.13.3.tar.gz", hash = "sha256:00edaa8da3a133674796cf5ea87d9f4b4c367d77476e185e80251cc13dfbb8c4", size = 40604, upload-time = "2021-12-10T21:09:39.158Z" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2b/e8/66e25efcc18542d58706ce4e50415710593721aae26e794ab1dec34fb66f/typeguard-4.5.1.tar.gz", hash = "sha256:f6f8ecbbc819c9bc749983cc67c02391e16a9b43b8b27f15dc70ed7c4a007274", size = 80121, upload-time = "2026-02-19T16:09:03.392Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/9a/bb/d43e5c75054e53efce310e79d63df0ac3f25e34c926be5dffb7d283fb2a8/typeguard-2.13.3-py3-none-any.whl", hash = "sha256:5e3e3be01e887e7eafae5af63d1f36c849aaa94e3a0112097312aabfa16284f1", size = 17605, upload-time = "2021-12-10T21:09:37.844Z" }, + { url = "https://files.pythonhosted.org/packages/91/88/b55b3117287a8540b76dbdd87733808d4d01c8067a3b339408c250bb3600/typeguard-4.5.1-py3-none-any.whl", hash = "sha256:44d2bf329d49a244110a090b55f5f91aa82d9a9834ebfd30bcc73651e4a8cc40", size = 36745, upload-time = "2026-02-19T16:09:01.6Z" }, ] [[package]] From 1f50f9949c4e20eba318b66cb8f25dd14995d899 Mon Sep 17 00:00:00 2001 From: Patrick Ritter <7950125+patrit@users.noreply.github.com> Date: Mon, 15 Jun 2026 12:24:44 +0200 Subject: [PATCH 2/2] fix: bump typeguard from 2.13.3 to 4.5.2 --- gitopscli/commands/add_pr_comment.py | 4 +++- gitopscli/commands/create_pr_preview.py | 4 +++- gitopscli/commands/create_preview.py | 10 +++++++--- gitopscli/commands/delete_pr_preview.py | 4 +++- gitopscli/commands/delete_preview.py | 9 +++++++-- gitopscli/commands/deploy.py | 4 +++- gitopscli/commands/sync_apps.py | 4 +++- gitopscli/commands/version.py | 4 +++- gitopscli/gitops_config.py | 24 ++++++++++++++---------- pyproject.toml | 1 - uv.lock | 8 +++----- 11 files changed, 49 insertions(+), 27 deletions(-) diff --git a/gitopscli/commands/add_pr_comment.py b/gitopscli/commands/add_pr_comment.py index 87f4e5b..d28665c 100644 --- a/gitopscli/commands/add_pr_comment.py +++ b/gitopscli/commands/add_pr_comment.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from gitopscli.git_api import GitApiConfig, GitRepoApiFactory @@ -15,7 +17,7 @@ class Args(GitApiConfig): parent_id: int | None text: str - def __init__(self, args: Args) -> None: + def __init__(self, args: AddPrCommentCommand.Args) -> None: self.__args = args def execute(self) -> None: diff --git a/gitopscli/commands/create_pr_preview.py b/gitopscli/commands/create_pr_preview.py index c25d356..af8e603 100644 --- a/gitopscli/commands/create_pr_preview.py +++ b/gitopscli/commands/create_pr_preview.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from gitopscli.git_api import GitApiConfig, GitRepoApiFactory @@ -21,7 +23,7 @@ class Args(GitApiConfig): pr_id: int parent_id: int | None - def __init__(self, args: Args) -> None: + def __init__(self, args: CreatePrPreviewCommand.Args) -> None: self.__args = args def execute(self) -> None: diff --git a/gitopscli/commands/create_preview.py b/gitopscli/commands/create_preview.py index 99339b8..f3c7463 100644 --- a/gitopscli/commands/create_preview.py +++ b/gitopscli/commands/create_preview.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import logging import shutil -from collections.abc import Callable from dataclasses import dataclass from pathlib import Path -from typing import Any +from typing import TYPE_CHECKING, Any from gitopscli.git_api import GitApiConfig, GitRepo, GitRepoApi, GitRepoApiFactory from gitopscli.gitops_config import GitOpsConfig @@ -13,6 +14,9 @@ from .command import Command from .common import load_gitops_config +if TYPE_CHECKING: + from collections.abc import Callable + class CreatePreviewCommand(Command): @dataclass(frozen=True) @@ -29,7 +33,7 @@ class Args(GitApiConfig): git_hash: str preview_id: str - def __init__(self, args: Args) -> None: + def __init__(self, args: CreatePreviewCommand.Args) -> None: self.__args = args self.__deployment_already_up_to_date_callback: Callable[[str], None] = lambda _: None self.__deployment_updated_callback: Callable[[str], None] = lambda _: None diff --git a/gitopscli/commands/delete_pr_preview.py b/gitopscli/commands/delete_pr_preview.py index 46e601e..927b055 100644 --- a/gitopscli/commands/delete_pr_preview.py +++ b/gitopscli/commands/delete_pr_preview.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from gitopscli.git_api import GitApiConfig @@ -21,7 +23,7 @@ class Args(GitApiConfig): branch: str expect_preview_exists: bool - def __init__(self, args: Args) -> None: + def __init__(self, args: DeletePrPreviewCommand.Args) -> None: self.__args = args def execute(self) -> None: diff --git a/gitopscli/commands/delete_preview.py b/gitopscli/commands/delete_preview.py index af6d5fb..1413dae 100644 --- a/gitopscli/commands/delete_preview.py +++ b/gitopscli/commands/delete_preview.py @@ -1,15 +1,20 @@ +from __future__ import annotations + import logging import shutil from dataclasses import dataclass from pathlib import Path +from typing import TYPE_CHECKING from gitopscli.git_api import GitApiConfig, GitRepo, GitRepoApi, GitRepoApiFactory -from gitopscli.gitops_config import GitOpsConfig from gitopscli.gitops_exception import GitOpsException from .command import Command from .common import load_gitops_config +if TYPE_CHECKING: + from gitopscli.gitops_config import GitOpsConfig + class DeletePreviewCommand(Command): @dataclass(frozen=True) @@ -26,7 +31,7 @@ class Args(GitApiConfig): preview_id: str expect_preview_exists: bool - def __init__(self, args: Args) -> None: + def __init__(self, args: DeletePreviewCommand.Args) -> None: self.__args = args def execute(self) -> None: diff --git a/gitopscli/commands/deploy.py b/gitopscli/commands/deploy.py index 705717e..6884abe 100644 --- a/gitopscli/commands/deploy.py +++ b/gitopscli/commands/deploy.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import json import logging import uuid @@ -37,7 +39,7 @@ class Args(GitApiConfig): merge_parameters: Any | None merge_method: Literal["squash", "rebase", "merge"] = "merge" - def __init__(self, args: Args) -> None: + def __init__(self, args: DeployCommand.Args) -> None: self.__args = args self.__commit_hashes: list[str] = [] diff --git a/gitopscli/commands/sync_apps.py b/gitopscli/commands/sync_apps.py index 9bfb933..509e981 100644 --- a/gitopscli/commands/sync_apps.py +++ b/gitopscli/commands/sync_apps.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import logging from dataclasses import dataclass @@ -24,7 +26,7 @@ class Args(GitApiConfig): root_organisation: str root_repository_name: str - def __init__(self, args: Args) -> None: + def __init__(self, args: SyncAppsCommand.Args) -> None: self.__args = args def execute(self) -> None: diff --git a/gitopscli/commands/version.py b/gitopscli/commands/version.py index 75e0095..528259c 100644 --- a/gitopscli/commands/version.py +++ b/gitopscli/commands/version.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import importlib.metadata from dataclasses import dataclass @@ -9,7 +11,7 @@ class VersionCommand(Command): class Args: pass - def __init__(self, args: Args) -> None: + def __init__(self, args: VersionCommand.Args) -> None: pass def execute(self) -> None: diff --git a/gitopscli/gitops_config.py b/gitopscli/gitops_config.py index 720fee6..3905ad1 100644 --- a/gitopscli/gitops_config.py +++ b/gitopscli/gitops_config.py @@ -1,12 +1,16 @@ +from __future__ import annotations + import hashlib import re -from collections.abc import Callable from dataclasses import dataclass from string import Template -from typing import Any, ClassVar, cast +from typing import TYPE_CHECKING, Any, ClassVar, cast from gitopscli.gitops_exception import GitOpsException +if TYPE_CHECKING: + from collections.abc import Callable + _VARIABLE_REGEX = re.compile(r"\${(\w+)}") @@ -15,11 +19,11 @@ class GitOpsConfig: class Replacement: @dataclass(frozen=True) class PreviewContext: - gitops_config: "GitOpsConfig" + gitops_config: GitOpsConfig preview_id: str git_hash: str - __VARIABLE_MAPPERS: ClassVar[dict[str, Callable[["GitOpsConfig.Replacement.PreviewContext"], str]]] = { + __VARIABLE_MAPPERS: ClassVar[dict[str, Callable[[GitOpsConfig.Replacement.PreviewContext], str]]] = { "GIT_HASH": lambda context: context.git_hash, "PREVIEW_HOST": lambda context: context.gitops_config.get_preview_host(context.preview_id), "PREVIEW_NAMESPACE": lambda context: context.gitops_config.get_preview_namespace(context.preview_id), @@ -44,7 +48,7 @@ def __init__(self, path: str, value_template: str) -> None: f"contains invalid variable: {var}", ) - def get_value(self, context: PreviewContext) -> str: + def get_value(self, context: GitOpsConfig.Replacement.PreviewContext) -> str: val = self.value_template for variable, value_func in self.__VARIABLE_MAPPERS.items(): val = val.replace(f"${{{variable}}}", value_func(context)) @@ -162,16 +166,16 @@ def get_preview_namespace(self, preview_id: str) -> str: raise GitOpsException(f"Invalid character in preview namespace: '{invalid_character[0]}'") return preview_namespace - def get_created_message(self, context: Replacement.PreviewContext) -> str: + def get_created_message(self, context: GitOpsConfig.Replacement.PreviewContext) -> str: return self.fill_template(self.messages_created_template, context) - def get_updated_message(self, context: Replacement.PreviewContext) -> str: + def get_updated_message(self, context: GitOpsConfig.Replacement.PreviewContext) -> str: return self.fill_template(self.messages_updated_template, context) - def get_uptodate_message(self, context: Replacement.PreviewContext) -> str: + def get_uptodate_message(self, context: GitOpsConfig.Replacement.PreviewContext) -> str: return self.fill_template(self.messages_uptodate_template, context) - def fill_template(self, template: str, context: Replacement.PreviewContext) -> str: + def fill_template(self, template: str, context: GitOpsConfig.Replacement.PreviewContext) -> str: return Template(template).substitute( APPLICATION_NAME=self.application_name, PREVIEW_ID_HASH=self.create_preview_id_hash(context.preview_id), @@ -213,7 +217,7 @@ def create_preview_id_hash_short(preview_id: str) -> str: return GitOpsConfig.create_preview_id_hash(preview_id)[:3] @staticmethod - def from_yaml(yaml: Any) -> "GitOpsConfig": + def from_yaml(yaml: Any) -> GitOpsConfig: return _GitOpsConfigYamlParser(yaml).parse() diff --git a/pyproject.toml b/pyproject.toml index 0d441b7..0c55f1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ dependencies = [ "pygithub", "python-gitlab>=2.6.0,<3", "azure-devops>=7,<8", - "typing_extensions>=4", ] [project.urls] diff --git a/uv.lock b/uv.lock index 99c33ed..722980d 100644 --- a/uv.lock +++ b/uv.lock @@ -546,7 +546,6 @@ dependencies = [ { name = "pygithub" }, { name = "python-gitlab" }, { name = "ruamel-yaml" }, - { name = "typing-extensions" }, ] [package.dev-dependencies] @@ -575,7 +574,6 @@ requires-dist = [ { name = "pygithub" }, { name = "python-gitlab", specifier = ">=2.6.0,<3" }, { name = "ruamel-yaml" }, - { name = "typing-extensions", specifier = ">=4" }, ] [package.metadata.requires-dev] @@ -1376,14 +1374,14 @@ wheels = [ [[package]] name = "typeguard" -version = "4.5.1" +version = "4.5.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/2b/e8/66e25efcc18542d58706ce4e50415710593721aae26e794ab1dec34fb66f/typeguard-4.5.1.tar.gz", hash = "sha256:f6f8ecbbc819c9bc749983cc67c02391e16a9b43b8b27f15dc70ed7c4a007274", size = 80121, upload-time = "2026-02-19T16:09:03.392Z" } +sdist = { url = "https://files.pythonhosted.org/packages/67/1c/dfba5c4633cafc4c701f237d2ba63b416805047fd6d96aab4cfc40969f98/typeguard-4.5.2.tar.gz", hash = "sha256:5a16dcac23502039299c97c8941651bc33d7ea8cc4b2f7d6bbb1b528f6eea423", size = 80240, upload-time = "2026-05-14T12:59:40.857Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/91/88/b55b3117287a8540b76dbdd87733808d4d01c8067a3b339408c250bb3600/typeguard-4.5.1-py3-none-any.whl", hash = "sha256:44d2bf329d49a244110a090b55f5f91aa82d9a9834ebfd30bcc73651e4a8cc40", size = 36745, upload-time = "2026-02-19T16:09:01.6Z" }, + { url = "https://files.pythonhosted.org/packages/5b/29/74eeb4d3f3ae61ca096b018ad486b3b3c74b17bec09ab4edab721cbefec3/typeguard-4.5.2-py3-none-any.whl", hash = "sha256:fcf9de18bd945cdb4c7b996e12b4c51ce83f92f191314a6d7cf1739586ec98cf", size = 36748, upload-time = "2026-05-14T12:59:39.473Z" }, ] [[package]]