From 83664c0edeb10393c9224adec60b0ff338f4cbf8 Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Thu, 5 Oct 2023 13:17:25 +0200 Subject: [PATCH] fix: typing for `kwargs` Signed-off-by: Jan Kowalleck --- cyclonedx/output/__init__.py | 6 +++--- cyclonedx/output/json.py | 2 +- cyclonedx/output/xml.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cyclonedx/output/__init__.py b/cyclonedx/output/__init__.py index b126501d..e151c1bf 100644 --- a/cyclonedx/output/__init__.py +++ b/cyclonedx/output/__init__.py @@ -20,7 +20,7 @@ import os from abc import ABC, abstractmethod from importlib import import_module -from typing import Any, Dict, Iterable, Optional, Type, Union +from typing import Any, Iterable, Optional, Type, Union from ..model.bom import Bom from ..model.component import Component @@ -72,12 +72,12 @@ def generate(self, force_regeneration: bool = False) -> None: @abstractmethod def output_as_string(self, *, indent: Optional[Union[int, str]] = None, - **kwargs: Dict[str, Any]) -> str: + **kwargs: Any) -> str: ... def output_to_file(self, filename: str, allow_overwrite: bool = False, *, indent: Optional[Union[int, str]] = None, - **kwargs: Dict[str, Any]) -> None: + **kwargs: Any) -> None: # Check directory writable output_filename = os.path.realpath(filename) output_directory = os.path.dirname(output_filename) diff --git a/cyclonedx/output/json.py b/cyclonedx/output/json.py index 2f6c4c77..4f9f6fce 100644 --- a/cyclonedx/output/json.py +++ b/cyclonedx/output/json.py @@ -73,7 +73,7 @@ def generate(self, force_regeneration: bool = False) -> None: def output_as_string(self, *, indent: Optional[Union[int, str]] = None, - **kwargs: Dict[str, Any]) -> str: + **kwargs: Any) -> str: self.generate() return json_dumps(self._bom_json, indent=indent) diff --git a/cyclonedx/output/xml.py b/cyclonedx/output/xml.py index 9bbf945d..d1fd7fcd 100644 --- a/cyclonedx/output/xml.py +++ b/cyclonedx/output/xml.py @@ -75,7 +75,7 @@ def __make_indent(v: Optional[Union[int, str]]) -> str: def output_as_string(self, *, indent: Optional[Union[int, str]] = None, - **kwargs: Dict[str, Any]) -> str: + **kwargs: Any) -> str: self.generate() return self._bom_xml if indent is None else dom_parseString(self._bom_xml).toprettyxml( indent=self.__make_indent(indent)