diff --git a/src/spdx_tools/common/typing/constructor_type_errors.py b/src/spdx_tools/common/typing/constructor_type_errors.py index 90c8d8402..e70f53329 100644 --- a/src/spdx_tools/common/typing/constructor_type_errors.py +++ b/src/spdx_tools/common/typing/constructor_type_errors.py @@ -1,4 +1,4 @@ -from typing import List +from beartype.typing import List class ConstructorTypeErrors(TypeError): diff --git a/src/spdx_tools/common/typing/type_checks.py b/src/spdx_tools/common/typing/type_checks.py index 26659c47c..d9dc9733a 100644 --- a/src/spdx_tools/common/typing/type_checks.py +++ b/src/spdx_tools/common/typing/type_checks.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from dataclasses import fields -from typing import Any, Dict + +from beartype.typing import Any, Dict from spdx_tools.common.typing.constructor_type_errors import ConstructorTypeErrors diff --git a/src/spdx_tools/spdx/clitools/pyspdxtools.py b/src/spdx_tools/spdx/clitools/pyspdxtools.py index 556033aee..8603b8401 100644 --- a/src/spdx_tools/spdx/clitools/pyspdxtools.py +++ b/src/spdx_tools/spdx/clitools/pyspdxtools.py @@ -14,9 +14,9 @@ # limitations under the License. import logging import sys -from typing import List import click +from beartype.typing import List from spdx_tools.spdx.graph_generation import export_graph_from_document from spdx_tools.spdx.model import Document diff --git a/src/spdx_tools/spdx/document_utils.py b/src/spdx_tools/spdx/document_utils.py index eb3612ab6..c0c0f5b27 100644 --- a/src/spdx_tools/spdx/document_utils.py +++ b/src/spdx_tools/spdx/document_utils.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from copy import deepcopy -from typing import Any, Dict, List, Union + +from beartype.typing import Any, Dict, List, Union from spdx_tools.spdx.model import Document, File, Package, Snippet diff --git a/src/spdx_tools/spdx/graph_generation.py b/src/spdx_tools/spdx/graph_generation.py index 1ef70a1c8..da4345d50 100644 --- a/src/spdx_tools/spdx/graph_generation.py +++ b/src/spdx_tools/spdx/graph_generation.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, List, Union +from beartype.typing import Dict, List, Union from spdx_tools.spdx.model import File, Package, Snippet diff --git a/src/spdx_tools/spdx/jsonschema/annotation_converter.py b/src/spdx_tools/spdx/jsonschema/annotation_converter.py index 7fbedf51f..16645a216 100644 --- a/src/spdx_tools/spdx/jsonschema/annotation_converter.py +++ b/src/spdx_tools/spdx/jsonschema/annotation_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.datetime_conversions import datetime_to_iso_string from spdx_tools.spdx.jsonschema.annotation_properties import AnnotationProperty diff --git a/src/spdx_tools/spdx/jsonschema/checksum_converter.py b/src/spdx_tools/spdx/jsonschema/checksum_converter.py index a1d2bb9fd..9ffb39b11 100644 --- a/src/spdx_tools/spdx/jsonschema/checksum_converter.py +++ b/src/spdx_tools/spdx/jsonschema/checksum_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Type +from beartype.typing import Type from spdx_tools.spdx.jsonschema.checksum_properties import ChecksumProperty from spdx_tools.spdx.jsonschema.converter import TypedConverter diff --git a/src/spdx_tools/spdx/jsonschema/converter.py b/src/spdx_tools/spdx/jsonschema/converter.py index 4ec479623..55629f2ae 100644 --- a/src/spdx_tools/spdx/jsonschema/converter.py +++ b/src/spdx_tools/spdx/jsonschema/converter.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from abc import ABC, abstractmethod -from typing import Any, Dict, Generic, Type, TypeVar + +from beartype.typing import Any, Dict, Generic, Type, TypeVar from spdx_tools.spdx.casing_tools import snake_case_to_camel_case from spdx_tools.spdx.jsonschema.json_property import JsonProperty diff --git a/src/spdx_tools/spdx/jsonschema/creation_info_converter.py b/src/spdx_tools/spdx/jsonschema/creation_info_converter.py index 6e84bfe19..0a2ef875c 100644 --- a/src/spdx_tools/spdx/jsonschema/creation_info_converter.py +++ b/src/spdx_tools/spdx/jsonschema/creation_info_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.datetime_conversions import datetime_to_iso_string from spdx_tools.spdx.jsonschema.converter import TypedConverter diff --git a/src/spdx_tools/spdx/jsonschema/document_converter.py b/src/spdx_tools/spdx/jsonschema/document_converter.py index 4d001c75c..a3c2e3699 100644 --- a/src/spdx_tools/spdx/jsonschema/document_converter.py +++ b/src/spdx_tools/spdx/jsonschema/document_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.document_utils import get_contained_spdx_element_ids from spdx_tools.spdx.jsonschema.annotation_converter import AnnotationConverter diff --git a/src/spdx_tools/spdx/jsonschema/external_document_ref_converter.py b/src/spdx_tools/spdx/jsonschema/external_document_ref_converter.py index c2e803662..f25bf56e3 100644 --- a/src/spdx_tools/spdx/jsonschema/external_document_ref_converter.py +++ b/src/spdx_tools/spdx/jsonschema/external_document_ref_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.jsonschema.checksum_converter import ChecksumConverter from spdx_tools.spdx.jsonschema.converter import TypedConverter diff --git a/src/spdx_tools/spdx/jsonschema/external_package_ref_converter.py b/src/spdx_tools/spdx/jsonschema/external_package_ref_converter.py index 36d528e26..732673c36 100644 --- a/src/spdx_tools/spdx/jsonschema/external_package_ref_converter.py +++ b/src/spdx_tools/spdx/jsonschema/external_package_ref_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.jsonschema.converter import TypedConverter from spdx_tools.spdx.jsonschema.external_package_ref_properties import ExternalPackageRefProperty diff --git a/src/spdx_tools/spdx/jsonschema/extracted_licensing_info_converter.py b/src/spdx_tools/spdx/jsonschema/extracted_licensing_info_converter.py index d7ada1c95..9bf0a8530 100644 --- a/src/spdx_tools/spdx/jsonschema/extracted_licensing_info_converter.py +++ b/src/spdx_tools/spdx/jsonschema/extracted_licensing_info_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.jsonschema.converter import TypedConverter from spdx_tools.spdx.jsonschema.extracted_licensing_info_properties import ExtractedLicensingInfoProperty diff --git a/src/spdx_tools/spdx/jsonschema/file_converter.py b/src/spdx_tools/spdx/jsonschema/file_converter.py index 20173f606..7c8ae4ad1 100644 --- a/src/spdx_tools/spdx/jsonschema/file_converter.py +++ b/src/spdx_tools/spdx/jsonschema/file_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.jsonschema.annotation_converter import AnnotationConverter from spdx_tools.spdx.jsonschema.checksum_converter import ChecksumConverter diff --git a/src/spdx_tools/spdx/jsonschema/optional_utils.py b/src/spdx_tools/spdx/jsonschema/optional_utils.py index 4f9d74074..3d3f9e223 100644 --- a/src/spdx_tools/spdx/jsonschema/optional_utils.py +++ b/src/spdx_tools/spdx/jsonschema/optional_utils.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Callable, Optional, TypeVar +from beartype.typing import Callable, Optional, TypeVar T = TypeVar("T") S = TypeVar("S") diff --git a/src/spdx_tools/spdx/jsonschema/package_converter.py b/src/spdx_tools/spdx/jsonschema/package_converter.py index 279eeb473..074fc7a78 100644 --- a/src/spdx_tools/spdx/jsonschema/package_converter.py +++ b/src/spdx_tools/spdx/jsonschema/package_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.datetime_conversions import datetime_to_iso_string from spdx_tools.spdx.jsonschema.annotation_converter import AnnotationConverter diff --git a/src/spdx_tools/spdx/jsonschema/package_verification_code_converter.py b/src/spdx_tools/spdx/jsonschema/package_verification_code_converter.py index 4076bb151..b98396272 100644 --- a/src/spdx_tools/spdx/jsonschema/package_verification_code_converter.py +++ b/src/spdx_tools/spdx/jsonschema/package_verification_code_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.jsonschema.converter import TypedConverter from spdx_tools.spdx.jsonschema.json_property import JsonProperty diff --git a/src/spdx_tools/spdx/jsonschema/relationship_converter.py b/src/spdx_tools/spdx/jsonschema/relationship_converter.py index 23b479e9e..78442d25b 100644 --- a/src/spdx_tools/spdx/jsonschema/relationship_converter.py +++ b/src/spdx_tools/spdx/jsonschema/relationship_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Type +from beartype.typing import Any, Type from spdx_tools.spdx.jsonschema.converter import TypedConverter from spdx_tools.spdx.jsonschema.json_property import JsonProperty diff --git a/src/spdx_tools/spdx/jsonschema/snippet_converter.py b/src/spdx_tools/spdx/jsonschema/snippet_converter.py index d0736a943..a4e75c4fa 100644 --- a/src/spdx_tools/spdx/jsonschema/snippet_converter.py +++ b/src/spdx_tools/spdx/jsonschema/snippet_converter.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Dict, Tuple, Type +from beartype.typing import Any, Dict, Tuple, Type from spdx_tools.spdx.jsonschema.annotation_converter import AnnotationConverter from spdx_tools.spdx.jsonschema.converter import TypedConverter diff --git a/src/spdx_tools/spdx/model/actor.py b/src/spdx_tools/spdx/model/actor.py index aff462bfc..9aeb9e059 100644 --- a/src/spdx_tools/spdx/model/actor.py +++ b/src/spdx_tools/spdx/model/actor.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from enum import Enum, auto -from typing import Optional + +from beartype.typing import Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx/model/document.py b/src/spdx_tools/spdx/model/document.py index ecfddc6a1..980c59ca5 100644 --- a/src/spdx_tools/spdx/model/document.py +++ b/src/spdx_tools/spdx/model/document.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx/model/extracted_licensing_info.py b/src/spdx_tools/spdx/model/extracted_licensing_info.py index 22df3ec19..e401dd7b6 100644 --- a/src/spdx_tools/spdx/model/extracted_licensing_info.py +++ b/src/spdx_tools/spdx/model/extracted_licensing_info.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from dataclasses import field -from typing import List, Optional, Union + +from beartype.typing import List, Optional, Union from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx/model/file.py b/src/spdx_tools/spdx/model/file.py index 1573f7475..27aae4ca3 100644 --- a/src/spdx_tools/spdx/model/file.py +++ b/src/spdx_tools/spdx/model/file.py @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from enum import Enum, auto -from typing import List, Optional, Union +from beartype.typing import List, Optional, Union from license_expression import LicenseExpression from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties diff --git a/src/spdx_tools/spdx/model/package.py b/src/spdx_tools/spdx/model/package.py index 53bc5e9db..1cf89e607 100644 --- a/src/spdx_tools/spdx/model/package.py +++ b/src/spdx_tools/spdx/model/package.py @@ -4,8 +4,8 @@ from dataclasses import field from datetime import datetime from enum import Enum, auto -from typing import Dict, List, Optional, Union +from beartype.typing import Dict, List, Optional, Union from license_expression import LicenseExpression from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties diff --git a/src/spdx_tools/spdx/model/relationship.py b/src/spdx_tools/spdx/model/relationship.py index 6005f7e2b..02b1326a9 100644 --- a/src/spdx_tools/spdx/model/relationship.py +++ b/src/spdx_tools/spdx/model/relationship.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from enum import Enum, auto -from typing import Optional, Union + +from beartype.typing import Optional, Union from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx/model/relationship_filters.py b/src/spdx_tools/spdx/model/relationship_filters.py index be04b34b9..8858fb038 100644 --- a/src/spdx_tools/spdx/model/relationship_filters.py +++ b/src/spdx_tools/spdx/model/relationship_filters.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx.model import Document, Package, Relationship, RelationshipType diff --git a/src/spdx_tools/spdx/model/snippet.py b/src/spdx_tools/spdx/model/snippet.py index 308c726cb..5a1669f4a 100644 --- a/src/spdx_tools/spdx/model/snippet.py +++ b/src/spdx_tools/spdx/model/snippet.py @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from dataclasses import field -from typing import List, Optional, Tuple, Union +from beartype.typing import List, Optional, Tuple, Union from license_expression import LicenseExpression from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties diff --git a/src/spdx_tools/spdx/parser/actor_parser.py b/src/spdx_tools/spdx/parser/actor_parser.py index 4d20f4629..734b41386 100644 --- a/src/spdx_tools/spdx/parser/actor_parser.py +++ b/src/spdx_tools/spdx/parser/actor_parser.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 import re -from typing import Match, Optional, Pattern + +from beartype.typing import Match, Optional, Pattern from spdx_tools.spdx.model import Actor, ActorType from spdx_tools.spdx.parser.error import SPDXParsingError diff --git a/src/spdx_tools/spdx/parser/error.py b/src/spdx_tools/spdx/parser/error.py index f3aaca7d0..1e58c1122 100644 --- a/src/spdx_tools/spdx/parser/error.py +++ b/src/spdx_tools/spdx/parser/error.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List class SPDXParsingError(Exception): diff --git a/src/spdx_tools/spdx/parser/json/json_parser.py b/src/spdx_tools/spdx/parser/json/json_parser.py index 0864caec6..9ca35fd85 100644 --- a/src/spdx_tools/spdx/parser/json/json_parser.py +++ b/src/spdx_tools/spdx/parser/json/json_parser.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 import json -from typing import Dict + +from beartype.typing import Dict from spdx_tools.spdx.model import Document from spdx_tools.spdx.parser.jsonlikedict.json_like_dict_parser import JsonLikeDictParser diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/annotation_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/annotation_parser.py index 02e47a1b0..38ccac3ff 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/annotation_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/annotation_parser.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import Dict, List, Optional + +from beartype.typing import Dict, List, Optional from spdx_tools.spdx.datetime_conversions import datetime_from_str from spdx_tools.spdx.model import Actor, Annotation, AnnotationType diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/checksum_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/checksum_parser.py index de1eada17..5da8ff544 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/checksum_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/checksum_parser.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, Optional +from beartype.typing import Dict, Optional from spdx_tools.spdx.model import Checksum, ChecksumAlgorithm from spdx_tools.spdx.parser.jsonlikedict.dict_parsing_functions import json_str_to_enum_name diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/creation_info_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/creation_info_parser.py index 1e7015c50..c530999f1 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/creation_info_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/creation_info_parser.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import Dict, List, Optional + +from beartype.typing import Dict, List, Optional from spdx_tools.spdx.datetime_conversions import datetime_from_str from spdx_tools.spdx.model import Actor, Checksum, CreationInfo, ExternalDocumentRef, Version diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/dict_parsing_functions.py b/src/spdx_tools/spdx/parser/jsonlikedict/dict_parsing_functions.py index c5076d2bf..0733317d1 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/dict_parsing_functions.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/dict_parsing_functions.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Callable, Dict, List, Optional +from beartype.typing import Any, Callable, Dict, List, Optional from spdx_tools.spdx.model import SpdxNoAssertion, SpdxNone from spdx_tools.spdx.parser.error import SPDXParsingError diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/extracted_licensing_info_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/extracted_licensing_info_parser.py index 8a75de24d..c0646084f 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/extracted_licensing_info_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/extracted_licensing_info_parser.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, List, Optional, Union +from beartype.typing import Dict, List, Optional, Union from spdx_tools.spdx.model import ExtractedLicensingInfo, SpdxNoAssertion from spdx_tools.spdx.parser.jsonlikedict.dict_parsing_functions import parse_field_or_no_assertion diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/file_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/file_parser.py index 53a9078db..77138ab40 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/file_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/file_parser.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, List, Optional, Union - +from beartype.typing import Dict, List, Optional, Union from license_expression import LicenseExpression from spdx_tools.spdx.model import Checksum, File, FileType, SpdxNoAssertion, SpdxNone diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/json_like_dict_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/json_like_dict_parser.py index 9465c0c76..31a41559a 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/json_like_dict_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/json_like_dict_parser.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict +from beartype.typing import Dict from spdx_tools.spdx.model import Document from spdx_tools.spdx.parser.error import SPDXParsingError diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/license_expression_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/license_expression_parser.py index de0b36cab..a7c242df2 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/license_expression_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/license_expression_parser.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Union - +from beartype.typing import Union from license_expression import ExpressionError, LicenseExpression, Licensing from spdx_tools.spdx.model import SpdxNoAssertion, SpdxNone diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/package_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/package_parser.py index fb4924a63..b395abd39 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/package_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/package_parser.py @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import Dict, List, Optional, Union +from beartype.typing import Dict, List, Optional, Union from license_expression import LicenseExpression from spdx_tools.spdx.datetime_conversions import datetime_from_str diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/relationship_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/relationship_parser.py index 5ffc5c6e6..432dd38dc 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/relationship_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/relationship_parser.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, List, Optional +from beartype.typing import Dict, List, Optional from spdx_tools.common.typing.constructor_type_errors import ConstructorTypeErrors from spdx_tools.spdx.model import Relationship, RelationshipType diff --git a/src/spdx_tools/spdx/parser/jsonlikedict/snippet_parser.py b/src/spdx_tools/spdx/parser/jsonlikedict/snippet_parser.py index 4f501608f..f00779407 100644 --- a/src/spdx_tools/spdx/parser/jsonlikedict/snippet_parser.py +++ b/src/spdx_tools/spdx/parser/jsonlikedict/snippet_parser.py @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from enum import Enum, auto -from typing import Dict, List, Optional, Tuple, Union +from beartype.typing import Dict, List, Optional, Tuple, Union from license_expression import LicenseExpression from spdx_tools.spdx.model import Snippet, SpdxNoAssertion, SpdxNone diff --git a/src/spdx_tools/spdx/parser/logger.py b/src/spdx_tools/spdx/parser/logger.py index 8a90453d8..343de7398 100644 --- a/src/spdx_tools/spdx/parser/logger.py +++ b/src/spdx_tools/spdx/parser/logger.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List class Logger: diff --git a/src/spdx_tools/spdx/parser/parsing_functions.py b/src/spdx_tools/spdx/parser/parsing_functions.py index f0e371d91..47f73951d 100644 --- a/src/spdx_tools/spdx/parser/parsing_functions.py +++ b/src/spdx_tools/spdx/parser/parsing_functions.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Dict +from beartype.typing import Any, Dict from spdx_tools.common.typing.constructor_type_errors import ConstructorTypeErrors from spdx_tools.spdx.parser.error import SPDXParsingError diff --git a/src/spdx_tools/spdx/parser/rdf/creation_info_parser.py b/src/spdx_tools/spdx/parser/rdf/creation_info_parser.py index 36376b128..7c70e0242 100644 --- a/src/spdx_tools/spdx/parser/rdf/creation_info_parser.py +++ b/src/spdx_tools/spdx/parser/rdf/creation_info_parser.py @@ -3,9 +3,9 @@ # SPDX-License-Identifier: Apache-2.0 import logging import sys -from typing import Tuple from urllib.parse import urldefrag +from beartype.typing import Tuple from rdflib import RDF, RDFS, Graph, Namespace from rdflib.exceptions import UniquenessError from rdflib.term import URIRef diff --git a/src/spdx_tools/spdx/parser/rdf/file_parser.py b/src/spdx_tools/spdx/parser/rdf/file_parser.py index 83e61b4a5..22323d09c 100644 --- a/src/spdx_tools/spdx/parser/rdf/file_parser.py +++ b/src/spdx_tools/spdx/parser/rdf/file_parser.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Union - +from beartype.typing import Union from rdflib import RDFS, BNode, Graph, URIRef from spdx_tools.spdx.model import File, FileType diff --git a/src/spdx_tools/spdx/parser/rdf/graph_parsing_functions.py b/src/spdx_tools/spdx/parser/rdf/graph_parsing_functions.py index 257367595..5e2b8e099 100644 --- a/src/spdx_tools/spdx/parser/rdf/graph_parsing_functions.py +++ b/src/spdx_tools/spdx/parser/rdf/graph_parsing_functions.py @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from enum import Enum -from typing import Any, Callable, Optional, Tuple, Type, Union +from beartype.typing import Any, Callable, Optional, Tuple, Type, Union from rdflib import RDF, Graph, URIRef from rdflib.exceptions import UniquenessError from rdflib.namespace import NamespaceManager diff --git a/src/spdx_tools/spdx/parser/rdf/license_expression_parser.py b/src/spdx_tools/spdx/parser/rdf/license_expression_parser.py index a55096976..64cc36755 100644 --- a/src/spdx_tools/spdx/parser/rdf/license_expression_parser.py +++ b/src/spdx_tools/spdx/parser/rdf/license_expression_parser.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Optional, Union - +from beartype.typing import Optional, Union from license_expression import LicenseExpression, get_spdx_licensing from rdflib import RDF, Graph from rdflib.term import BNode, Identifier, Node, URIRef diff --git a/src/spdx_tools/spdx/parser/rdf/package_parser.py b/src/spdx_tools/spdx/parser/rdf/package_parser.py index a0de0e904..668377162 100644 --- a/src/spdx_tools/spdx/parser/rdf/package_parser.py +++ b/src/spdx_tools/spdx/parser/rdf/package_parser.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Optional, Union - +from beartype.typing import Optional, Union from rdflib import DOAP, RDFS, Graph, URIRef from rdflib.term import BNode diff --git a/src/spdx_tools/spdx/parser/rdf/rdf_parser.py b/src/spdx_tools/spdx/parser/rdf/rdf_parser.py index d6406f3f0..3856f8d59 100644 --- a/src/spdx_tools/spdx/parser/rdf/rdf_parser.py +++ b/src/spdx_tools/spdx/parser/rdf/rdf_parser.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Dict - +from beartype.typing import Any, Dict from rdflib import RDF, Graph from spdx_tools.spdx.model import Document, RelationshipType diff --git a/src/spdx_tools/spdx/parser/rdf/snippet_parser.py b/src/spdx_tools/spdx/parser/rdf/snippet_parser.py index e59076654..d09671f60 100644 --- a/src/spdx_tools/spdx/parser/rdf/snippet_parser.py +++ b/src/spdx_tools/spdx/parser/rdf/snippet_parser.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, Optional, Tuple, Union - +from beartype.typing import Dict, Optional, Tuple, Union from rdflib import RDF, RDFS, Graph from rdflib.exceptions import UniquenessError from rdflib.term import BNode, Node, URIRef diff --git a/src/spdx_tools/spdx/parser/tagvalue/helper_methods.py b/src/spdx_tools/spdx/parser/tagvalue/helper_methods.py index d8cfef77a..ea528a434 100644 --- a/src/spdx_tools/spdx/parser/tagvalue/helper_methods.py +++ b/src/spdx_tools/spdx/parser/tagvalue/helper_methods.py @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 import re -from typing import Any, Callable, Dict, Optional +from beartype.typing import Any, Callable, Dict, Optional from ply.yacc import YaccProduction from spdx_tools.spdx.casing_tools import camel_case_to_snake_case diff --git a/src/spdx_tools/spdx/parser/tagvalue/parser.py b/src/spdx_tools/spdx/parser/tagvalue/parser.py index 623226b8f..ec843ccb9 100644 --- a/src/spdx_tools/spdx/parser/tagvalue/parser.py +++ b/src/spdx_tools/spdx/parser/tagvalue/parser.py @@ -12,8 +12,8 @@ # limitations under the License. import re -from typing import Any, Dict, List +from beartype.typing import Any, Dict, List from license_expression import get_spdx_licensing from ply import yacc from ply.yacc import LRParser diff --git a/src/spdx_tools/spdx/parser/xml/xml_parser.py b/src/spdx_tools/spdx/parser/xml/xml_parser.py index 4dd8c3aa2..f0cd77025 100644 --- a/src/spdx_tools/spdx/parser/xml/xml_parser.py +++ b/src/spdx_tools/spdx/parser/xml/xml_parser.py @@ -1,9 +1,8 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Any, Dict - import xmltodict +from beartype.typing import Any, Dict from spdx_tools.spdx.model import Document from spdx_tools.spdx.parser.error import SPDXParsingError diff --git a/src/spdx_tools/spdx/parser/yaml/yaml_parser.py b/src/spdx_tools/spdx/parser/yaml/yaml_parser.py index 021858137..1a7349eb8 100644 --- a/src/spdx_tools/spdx/parser/yaml/yaml_parser.py +++ b/src/spdx_tools/spdx/parser/yaml/yaml_parser.py @@ -1,9 +1,8 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict - import yaml +from beartype.typing import Dict from spdx_tools.spdx.model import Document from spdx_tools.spdx.parser.jsonlikedict.json_like_dict_parser import JsonLikeDictParser diff --git a/src/spdx_tools/spdx/spdx_element_utils.py b/src/spdx_tools/spdx/spdx_element_utils.py index 94d45ba44..49b466144 100644 --- a/src/spdx_tools/spdx/spdx_element_utils.py +++ b/src/spdx_tools/spdx/spdx_element_utils.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Union +from beartype.typing import List, Union from spdx_tools.spdx.model import ExternalDocumentRef, File, Package, Snippet diff --git a/src/spdx_tools/spdx/validation/actor_validator.py b/src/spdx_tools/spdx/validation/actor_validator.py index 313f7d3e1..3ae5f8656 100644 --- a/src/spdx_tools/spdx/validation/actor_validator.py +++ b/src/spdx_tools/spdx/validation/actor_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx.model import Actor, ActorType from spdx_tools.spdx.validation.validation_message import SpdxElementType, ValidationContext, ValidationMessage diff --git a/src/spdx_tools/spdx/validation/annotation_validator.py b/src/spdx_tools/spdx/validation/annotation_validator.py index dbfa1bed2..3fec188c7 100644 --- a/src/spdx_tools/spdx/validation/annotation_validator.py +++ b/src/spdx_tools/spdx/validation/annotation_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx.model import Annotation, Document from spdx_tools.spdx.validation.actor_validator import validate_actor diff --git a/src/spdx_tools/spdx/validation/checksum_validator.py b/src/spdx_tools/spdx/validation/checksum_validator.py index 67df436ca..2a9d055c8 100644 --- a/src/spdx_tools/spdx/validation/checksum_validator.py +++ b/src/spdx_tools/spdx/validation/checksum_validator.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import re -from typing import Dict, List + +from beartype.typing import Dict, List from spdx_tools.spdx.model import Checksum, ChecksumAlgorithm from spdx_tools.spdx.validation.validation_message import SpdxElementType, ValidationContext, ValidationMessage diff --git a/src/spdx_tools/spdx/validation/creation_info_validator.py b/src/spdx_tools/spdx/validation/creation_info_validator.py index 55bac981d..79490c77c 100644 --- a/src/spdx_tools/spdx/validation/creation_info_validator.py +++ b/src/spdx_tools/spdx/validation/creation_info_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx.constants import DOCUMENT_SPDX_ID from spdx_tools.spdx.model import CreationInfo diff --git a/src/spdx_tools/spdx/validation/document_validator.py b/src/spdx_tools/spdx/validation/document_validator.py index 41e5c7d9b..b6fba74b8 100644 --- a/src/spdx_tools/spdx/validation/document_validator.py +++ b/src/spdx_tools/spdx/validation/document_validator.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2022 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx.model import Document, RelationshipType from spdx_tools.spdx.model.relationship_filters import filter_by_type_and_origin, filter_by_type_and_target diff --git a/src/spdx_tools/spdx/validation/external_document_ref_validator.py b/src/spdx_tools/spdx/validation/external_document_ref_validator.py index 1dd7da0c3..52f50a665 100644 --- a/src/spdx_tools/spdx/validation/external_document_ref_validator.py +++ b/src/spdx_tools/spdx/validation/external_document_ref_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx.model import ExternalDocumentRef from spdx_tools.spdx.validation.checksum_validator import validate_checksum diff --git a/src/spdx_tools/spdx/validation/external_package_ref_validator.py b/src/spdx_tools/spdx/validation/external_package_ref_validator.py index e785891fb..7dd316354 100644 --- a/src/spdx_tools/spdx/validation/external_package_ref_validator.py +++ b/src/spdx_tools/spdx/validation/external_package_ref_validator.py @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 import re -from typing import Dict, List import uritools +from beartype.typing import Dict, List from spdx_tools.spdx.model import ExternalPackageRef, ExternalPackageRefCategory from spdx_tools.spdx.model.package import CATEGORY_TO_EXTERNAL_PACKAGE_REF_TYPES diff --git a/src/spdx_tools/spdx/validation/extracted_licensing_info_validator.py b/src/spdx_tools/spdx/validation/extracted_licensing_info_validator.py index 86df9ca77..6cca07576 100644 --- a/src/spdx_tools/spdx/validation/extracted_licensing_info_validator.py +++ b/src/spdx_tools/spdx/validation/extracted_licensing_info_validator.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import re -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.spdx.model import ExtractedLicensingInfo from spdx_tools.spdx.validation.uri_validators import validate_url diff --git a/src/spdx_tools/spdx/validation/file_validator.py b/src/spdx_tools/spdx/validation/file_validator.py index 77cf6a5d1..a14efd4c4 100644 --- a/src/spdx_tools/spdx/validation/file_validator.py +++ b/src/spdx_tools/spdx/validation/file_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.spdx.model import ChecksumAlgorithm, Document, File from spdx_tools.spdx.validation.checksum_validator import validate_checksums diff --git a/src/spdx_tools/spdx/validation/license_expression_validator.py b/src/spdx_tools/spdx/validation/license_expression_validator.py index e9b52ca7a..bce5c9eb3 100644 --- a/src/spdx_tools/spdx/validation/license_expression_validator.py +++ b/src/spdx_tools/spdx/validation/license_expression_validator.py @@ -2,8 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional, Union - +from beartype.typing import List, Optional, Union from license_expression import ExpressionError, ExpressionParseError, LicenseExpression, get_spdx_licensing from spdx_tools.spdx.model import Document, SpdxNoAssertion, SpdxNone diff --git a/src/spdx_tools/spdx/validation/package_validator.py b/src/spdx_tools/spdx/validation/package_validator.py index dc41dcf4c..4307fc8ef 100644 --- a/src/spdx_tools/spdx/validation/package_validator.py +++ b/src/spdx_tools/spdx/validation/package_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.spdx.model import Document, Package, Relationship, RelationshipType from spdx_tools.spdx.model.relationship_filters import filter_by_type_and_origin, filter_by_type_and_target diff --git a/src/spdx_tools/spdx/validation/package_verification_code_validator.py b/src/spdx_tools/spdx/validation/package_verification_code_validator.py index fb79135ba..55dd1bb35 100644 --- a/src/spdx_tools/spdx/validation/package_verification_code_validator.py +++ b/src/spdx_tools/spdx/validation/package_verification_code_validator.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import re -from typing import List + +from beartype.typing import List from spdx_tools.spdx.model import PackageVerificationCode from spdx_tools.spdx.validation.validation_message import SpdxElementType, ValidationContext, ValidationMessage diff --git a/src/spdx_tools/spdx/validation/relationship_validator.py b/src/spdx_tools/spdx/validation/relationship_validator.py index 1f9430683..1c194ac99 100644 --- a/src/spdx_tools/spdx/validation/relationship_validator.py +++ b/src/spdx_tools/spdx/validation/relationship_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx.model import Document, Relationship, RelationshipType, SpdxNoAssertion, SpdxNone from spdx_tools.spdx.validation.spdx_id_validators import validate_spdx_id diff --git a/src/spdx_tools/spdx/validation/snippet_validator.py b/src/spdx_tools/spdx/validation/snippet_validator.py index aab0e606d..8c1aed9c5 100644 --- a/src/spdx_tools/spdx/validation/snippet_validator.py +++ b/src/spdx_tools/spdx/validation/snippet_validator.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.spdx.model import Document, Snippet from spdx_tools.spdx.validation.license_expression_validator import ( diff --git a/src/spdx_tools/spdx/validation/spdx_id_validators.py b/src/spdx_tools/spdx/validation/spdx_id_validators.py index 0d78900a6..6441236a9 100644 --- a/src/spdx_tools/spdx/validation/spdx_id_validators.py +++ b/src/spdx_tools/spdx/validation/spdx_id_validators.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import re -from typing import List + +from beartype.typing import List from spdx_tools.spdx.document_utils import get_contained_spdx_element_ids from spdx_tools.spdx.model import Document, File diff --git a/src/spdx_tools/spdx/validation/uri_validators.py b/src/spdx_tools/spdx/validation/uri_validators.py index 5b30f6b7d..d9c23f97a 100644 --- a/src/spdx_tools/spdx/validation/uri_validators.py +++ b/src/spdx_tools/spdx/validation/uri_validators.py @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import re -from typing import List +from beartype.typing import List from uritools import isabsuri, urisplit url_pattern = ( diff --git a/src/spdx_tools/spdx/validation/validation_message.py b/src/spdx_tools/spdx/validation/validation_message.py index 7b4178703..2ef1ba241 100644 --- a/src/spdx_tools/spdx/validation/validation_message.py +++ b/src/spdx_tools/spdx/validation/validation_message.py @@ -4,7 +4,8 @@ from dataclasses import dataclass from enum import Enum, auto -from typing import Any, Optional + +from beartype.typing import Any, Optional class SpdxElementType(Enum): diff --git a/src/spdx_tools/spdx/writer/json/json_writer.py b/src/spdx_tools/spdx/writer/json/json_writer.py index 0b939c039..a644bd889 100644 --- a/src/spdx_tools/spdx/writer/json/json_writer.py +++ b/src/spdx_tools/spdx/writer/json/json_writer.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 import json -from typing import List + +from beartype.typing import List from spdx_tools.spdx.document_utils import create_document_without_duplicates from spdx_tools.spdx.jsonschema.document_converter import DocumentConverter diff --git a/src/spdx_tools/spdx/writer/rdf/annotation_writer.py b/src/spdx_tools/spdx/writer/rdf/annotation_writer.py index dd51b47e6..e973eeb0d 100644 --- a/src/spdx_tools/spdx/writer/rdf/annotation_writer.py +++ b/src/spdx_tools/spdx/writer/rdf/annotation_writer.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict - +from beartype.typing import Dict from rdflib import RDF, RDFS, BNode, Graph, Literal, URIRef from spdx_tools.spdx.casing_tools import snake_case_to_camel_case diff --git a/src/spdx_tools/spdx/writer/rdf/file_writer.py b/src/spdx_tools/spdx/writer/rdf/file_writer.py index 649a1e6e0..679be8d22 100644 --- a/src/spdx_tools/spdx/writer/rdf/file_writer.py +++ b/src/spdx_tools/spdx/writer/rdf/file_writer.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict - +from beartype.typing import Dict from rdflib import RDF, RDFS, Graph, Literal, URIRef from spdx_tools.spdx.casing_tools import snake_case_to_camel_case diff --git a/src/spdx_tools/spdx/writer/rdf/license_expression_writer.py b/src/spdx_tools/spdx/writer/rdf/license_expression_writer.py index b6acfe1ad..1057f6efd 100644 --- a/src/spdx_tools/spdx/writer/rdf/license_expression_writer.py +++ b/src/spdx_tools/spdx/writer/rdf/license_expression_writer.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Union - +from beartype.typing import List, Union from boolean import Expression from license_expression import ( AND, diff --git a/src/spdx_tools/spdx/writer/rdf/package_writer.py b/src/spdx_tools/spdx/writer/rdf/package_writer.py index 90d21c145..2137d0dbd 100644 --- a/src/spdx_tools/spdx/writer/rdf/package_writer.py +++ b/src/spdx_tools/spdx/writer/rdf/package_writer.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict - +from beartype.typing import Dict from rdflib import DOAP, RDF, RDFS, XSD, BNode, Graph, Literal, URIRef from spdx_tools.spdx.casing_tools import snake_case_to_camel_case diff --git a/src/spdx_tools/spdx/writer/rdf/rdf_writer.py b/src/spdx_tools/spdx/writer/rdf/rdf_writer.py index 360337abc..7c85613ec 100644 --- a/src/spdx_tools/spdx/writer/rdf/rdf_writer.py +++ b/src/spdx_tools/spdx/writer/rdf/rdf_writer.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, List - +from beartype.typing import Dict, List from rdflib import DOAP, Graph from rdflib.compare import to_isomorphic diff --git a/src/spdx_tools/spdx/writer/rdf/relationship_writer.py b/src/spdx_tools/spdx/writer/rdf/relationship_writer.py index 82b5b59d5..6d49431af 100644 --- a/src/spdx_tools/spdx/writer/rdf/relationship_writer.py +++ b/src/spdx_tools/spdx/writer/rdf/relationship_writer.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict - +from beartype.typing import Dict from rdflib import RDF, RDFS, BNode, Graph, Literal, URIRef from spdx_tools.spdx.casing_tools import snake_case_to_camel_case diff --git a/src/spdx_tools/spdx/writer/rdf/snippet_writer.py b/src/spdx_tools/spdx/writer/rdf/snippet_writer.py index f45759c9b..0b8cd4e95 100644 --- a/src/spdx_tools/spdx/writer/rdf/snippet_writer.py +++ b/src/spdx_tools/spdx/writer/rdf/snippet_writer.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict, Optional, Tuple - +from beartype.typing import Dict, Optional, Tuple from rdflib import RDF, RDFS, BNode, Graph, Literal, URIRef from spdx_tools.spdx.model import Snippet diff --git a/src/spdx_tools/spdx/writer/rdf/writer_utils.py b/src/spdx_tools/spdx/writer/rdf/writer_utils.py index 9bca3f470..fb27aa18b 100644 --- a/src/spdx_tools/spdx/writer/rdf/writer_utils.py +++ b/src/spdx_tools/spdx/writer/rdf/writer_utils.py @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import logging from datetime import datetime -from typing import Any, Dict, Optional +from beartype.typing import Any, Dict, Optional from rdflib import Graph, Literal from rdflib.term import Node diff --git a/src/spdx_tools/spdx/writer/tagvalue/annotation_writer.py b/src/spdx_tools/spdx/writer/tagvalue/annotation_writer.py index 0be7663c4..5c9bd85ee 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/annotation_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/annotation_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx.datetime_conversions import datetime_to_iso_string from spdx_tools.spdx.model import Annotation diff --git a/src/spdx_tools/spdx/writer/tagvalue/creation_info_writer.py b/src/spdx_tools/spdx/writer/tagvalue/creation_info_writer.py index 9e87b0925..6987702d5 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/creation_info_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/creation_info_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx.datetime_conversions import datetime_to_iso_string from spdx_tools.spdx.model import CreationInfo diff --git a/src/spdx_tools/spdx/writer/tagvalue/extracted_licensing_info_writer.py b/src/spdx_tools/spdx/writer/tagvalue/extracted_licensing_info_writer.py index 89734c8c8..356722859 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/extracted_licensing_info_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/extracted_licensing_info_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx.model import ExtractedLicensingInfo from spdx_tools.spdx.writer.tagvalue.tagvalue_writer_helper_functions import write_text_value, write_value diff --git a/src/spdx_tools/spdx/writer/tagvalue/file_writer.py b/src/spdx_tools/spdx/writer/tagvalue/file_writer.py index 8848d9aae..d3f3d85e3 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/file_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/file_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx.model import File from spdx_tools.spdx.writer.tagvalue.checksum_writer import write_checksum_to_tag_value diff --git a/src/spdx_tools/spdx/writer/tagvalue/package_writer.py b/src/spdx_tools/spdx/writer/tagvalue/package_writer.py index d690773e0..8ba0f8f0e 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/package_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/package_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx.datetime_conversions import datetime_to_iso_string from spdx_tools.spdx.model import Package, PackageVerificationCode diff --git a/src/spdx_tools/spdx/writer/tagvalue/relationship_writer.py b/src/spdx_tools/spdx/writer/tagvalue/relationship_writer.py index a46f0c7cc..a9cb9b754 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/relationship_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/relationship_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx.model import Relationship from spdx_tools.spdx.writer.tagvalue.tagvalue_writer_helper_functions import write_text_value, write_value diff --git a/src/spdx_tools/spdx/writer/tagvalue/snippet_writer.py b/src/spdx_tools/spdx/writer/tagvalue/snippet_writer.py index de8ce16d4..f5cd2e84d 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/snippet_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/snippet_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx.model import Snippet from spdx_tools.spdx.writer.tagvalue.tagvalue_writer_helper_functions import write_range, write_text_value, write_value diff --git a/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer.py b/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer.py index 37a54cae3..d82a1213e 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer.py +++ b/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, TextIO +from beartype.typing import List, TextIO from spdx_tools.spdx.document_utils import create_document_without_duplicates from spdx_tools.spdx.model import Document diff --git a/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer_helper_functions.py b/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer_helper_functions.py index 2e638f943..458d76711 100644 --- a/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer_helper_functions.py +++ b/src/spdx_tools/spdx/writer/tagvalue/tagvalue_writer_helper_functions.py @@ -8,8 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import Any, Callable, Dict, List, Optional, TextIO, Tuple, Union - +from beartype.typing import Any, Callable, Dict, List, Optional, TextIO, Tuple, Union from license_expression import LicenseExpression from spdx_tools.spdx.model import ( diff --git a/src/spdx_tools/spdx/writer/xml/xml_writer.py b/src/spdx_tools/spdx/writer/xml/xml_writer.py index 73070b123..70484da4b 100644 --- a/src/spdx_tools/spdx/writer/xml/xml_writer.py +++ b/src/spdx_tools/spdx/writer/xml/xml_writer.py @@ -1,9 +1,8 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List - import xmltodict +from beartype.typing import List from spdx_tools.spdx.document_utils import create_document_without_duplicates from spdx_tools.spdx.jsonschema.document_converter import DocumentConverter diff --git a/src/spdx_tools/spdx/writer/yaml/yaml_writer.py b/src/spdx_tools/spdx/writer/yaml/yaml_writer.py index 4c354a157..5211fd3de 100644 --- a/src/spdx_tools/spdx/writer/yaml/yaml_writer.py +++ b/src/spdx_tools/spdx/writer/yaml/yaml_writer.py @@ -1,9 +1,8 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List - import yaml +from beartype.typing import List from spdx_tools.spdx.document_utils import create_document_without_duplicates from spdx_tools.spdx.jsonschema.document_converter import DocumentConverter diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/actor.py b/src/spdx_tools/spdx3/bump_from_spdx2/actor.py index 6a84af7a1..3fac60412 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/actor.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/actor.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx3.model import CreationInfo, ExternalIdentifier, ExternalIdentifierType, Organization, Person, Tool from spdx_tools.spdx3.payload import Payload diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/bump_utils.py b/src/spdx_tools/spdx3/bump_from_spdx2/bump_utils.py index e45b05909..f4b6a4bf9 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/bump_utils.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/bump_utils.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Optional, Union +from beartype.typing import Optional, Union from spdx_tools.spdx.model.spdx_no_assertion import SpdxNoAssertion from spdx_tools.spdx.model.spdx_none import SpdxNone diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/creation_info.py b/src/spdx_tools/spdx3/bump_from_spdx2/creation_info.py index 30532b463..17a957c4f 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/creation_info.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/creation_info.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List - +from beartype.typing import List from semantic_version import Version from spdx_tools.spdx3.bump_from_spdx2.actor import bump_actor diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/external_document_ref.py b/src/spdx_tools/spdx3/bump_from_spdx2/external_document_ref.py index 1e496aa16..41360ffa4 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/external_document_ref.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/external_document_ref.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Tuple +from beartype.typing import List, Tuple from spdx_tools.spdx3.bump_from_spdx2.checksum import bump_checksum from spdx_tools.spdx3.model import ExternalMap, Hash, NamespaceMap diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/file.py b/src/spdx_tools/spdx3/bump_from_spdx2/file.py index 93f8495a7..c1f8226aa 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/file.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/file.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.spdx3.bump_from_spdx2.checksum import bump_checksum from spdx_tools.spdx3.bump_from_spdx2.license_expression import bump_license_expression_or_none_or_no_assertion diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/license_expression.py b/src/spdx_tools/spdx3/bump_from_spdx2/license_expression.py index 6b65b6642..ddd04ecdd 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/license_expression.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/license_expression.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Union - +from beartype.typing import List, Union from license_expression import ( AND, OR, diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/package.py b/src/spdx_tools/spdx3/bump_from_spdx2/package.py index 814e1f849..bd0a07d11 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/package.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/package.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional, Union +from beartype.typing import List, Optional, Union from spdx_tools.spdx3.bump_from_spdx2.actor import bump_actor from spdx_tools.spdx3.bump_from_spdx2.bump_utils import handle_no_assertion_or_none diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/relationship.py b/src/spdx_tools/spdx3/bump_from_spdx2/relationship.py index d406713e6..ee5d35418 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/relationship.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 import logging import sys -from typing import Dict, List, Optional, Tuple, Union + +from beartype.typing import Dict, List, Optional, Tuple, Union from spdx_tools.spdx3.bump_from_spdx2.message import print_missing_conversion from spdx_tools.spdx3.model import ( diff --git a/src/spdx_tools/spdx3/bump_from_spdx2/snippet.py b/src/spdx_tools/spdx3/bump_from_spdx2/snippet.py index 221c96926..7810357a5 100644 --- a/src/spdx_tools/spdx3/bump_from_spdx2/snippet.py +++ b/src/spdx_tools/spdx3/bump_from_spdx2/snippet.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional, Tuple +from beartype.typing import List, Optional, Tuple from spdx_tools.spdx3.bump_from_spdx2.license_expression import bump_license_expression_or_none_or_no_assertion from spdx_tools.spdx3.bump_from_spdx2.message import print_missing_conversion diff --git a/src/spdx_tools/spdx3/clitools/pyspdxtools3.py b/src/spdx_tools/spdx3/clitools/pyspdxtools3.py index 3a9b45a7a..9dd21a5d1 100644 --- a/src/spdx_tools/spdx3/clitools/pyspdxtools3.py +++ b/src/spdx_tools/spdx3/clitools/pyspdxtools3.py @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 import sys -from typing import List import click +from beartype.typing import List from spdx_tools.spdx3.bump_from_spdx2.spdx_document import bump_spdx_document from spdx_tools.spdx3.payload import Payload diff --git a/src/spdx_tools/spdx3/model/agent.py b/src/spdx_tools/spdx3/model/agent.py index 438b9de89..0470ed304 100644 --- a/src/spdx_tools/spdx3/model/agent.py +++ b/src/spdx_tools/spdx3/model/agent.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/ai/ai_package.py b/src/spdx_tools/spdx3/model/ai/ai_package.py index 03a698768..9d5dd4114 100644 --- a/src/spdx_tools/spdx3/model/ai/ai_package.py +++ b/src/spdx_tools/spdx3/model/ai/ai_package.py @@ -4,7 +4,8 @@ from dataclasses import field from datetime import datetime from enum import Enum, auto -from typing import Dict, List, Optional + +from beartype.typing import Dict, List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/annotation.py b/src/spdx_tools/spdx3/model/annotation.py index 14bc40d9e..9a016cfe8 100644 --- a/src/spdx_tools/spdx3/model/annotation.py +++ b/src/spdx_tools/spdx3/model/annotation.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/artifact.py b/src/spdx_tools/spdx3/model/artifact.py index bb88fea41..0fccec89c 100644 --- a/src/spdx_tools/spdx3/model/artifact.py +++ b/src/spdx_tools/spdx3/model/artifact.py @@ -4,7 +4,8 @@ from abc import abstractmethod from dataclasses import field from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.spdx3.model import Element diff --git a/src/spdx_tools/spdx3/model/bom.py b/src/spdx_tools/spdx3/model/bom.py index 2772eb54d..332d31652 100644 --- a/src/spdx_tools/spdx3/model/bom.py +++ b/src/spdx_tools/spdx3/model/bom.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/build/build.py b/src/spdx_tools/spdx3/model/build/build.py index 3294c95ea..8d784e819 100644 --- a/src/spdx_tools/spdx3/model/build/build.py +++ b/src/spdx_tools/spdx3/model/build/build.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from datetime import datetime -from typing import Dict, List, Optional + +from beartype.typing import Dict, List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/bundle.py b/src/spdx_tools/spdx3/model/bundle.py index 04ead471e..c90352308 100644 --- a/src/spdx_tools/spdx3/model/bundle.py +++ b/src/spdx_tools/spdx3/model/bundle.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/creation_info.py b/src/spdx_tools/spdx3/model/creation_info.py index 40f02abea..615a30445 100644 --- a/src/spdx_tools/spdx3/model/creation_info.py +++ b/src/spdx_tools/spdx3/model/creation_info.py @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional +from beartype.typing import List, Optional from semantic_version import Version from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties diff --git a/src/spdx_tools/spdx3/model/dataset/dataset.py b/src/spdx_tools/spdx3/model/dataset/dataset.py index e6da96eb5..774a3bef2 100644 --- a/src/spdx_tools/spdx3/model/dataset/dataset.py +++ b/src/spdx_tools/spdx3/model/dataset/dataset.py @@ -4,7 +4,8 @@ from dataclasses import field from datetime import datetime from enum import Enum, auto -from typing import Dict, List, Optional + +from beartype.typing import Dict, List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/element.py b/src/spdx_tools/spdx3/model/element.py index 3b75dcf8a..f5ec4790e 100644 --- a/src/spdx_tools/spdx3/model/element.py +++ b/src/spdx_tools/spdx3/model/element.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from abc import ABC, abstractmethod from dataclasses import field -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.spdx3.model import CreationInfo, ExternalIdentifier, ExternalReference, IntegrityMethod diff --git a/src/spdx_tools/spdx3/model/external_identifier.py b/src/spdx_tools/spdx3/model/external_identifier.py index e44d63d89..a7ae2a8d2 100644 --- a/src/spdx_tools/spdx3/model/external_identifier.py +++ b/src/spdx_tools/spdx3/model/external_identifier.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/external_map.py b/src/spdx_tools/spdx3/model/external_map.py index 91ec7dd2c..ab88a49e2 100644 --- a/src/spdx_tools/spdx3/model/external_map.py +++ b/src/spdx_tools/spdx3/model/external_map.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from dataclasses import field -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/external_reference.py b/src/spdx_tools/spdx3/model/external_reference.py index 127253595..5e29aa583 100644 --- a/src/spdx_tools/spdx3/model/external_reference.py +++ b/src/spdx_tools/spdx3/model/external_reference.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/hash.py b/src/spdx_tools/spdx3/model/hash.py index 611c04393..42ef4ff4d 100644 --- a/src/spdx_tools/spdx3/model/hash.py +++ b/src/spdx_tools/spdx3/model/hash.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from enum import Enum, auto -from typing import Optional + +from beartype.typing import Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/integrity_method.py b/src/spdx_tools/spdx3/model/integrity_method.py index aac00ab11..17fefef16 100644 --- a/src/spdx_tools/spdx3/model/integrity_method.py +++ b/src/spdx_tools/spdx3/model/integrity_method.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from abc import ABC, abstractmethod -from typing import Optional + +from beartype.typing import Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties diff --git a/src/spdx_tools/spdx3/model/licensing/conjunctive_license_set.py b/src/spdx_tools/spdx3/model/licensing/conjunctive_license_set.py index e8e4f5611..fe5605761 100644 --- a/src/spdx_tools/spdx3/model/licensing/conjunctive_license_set.py +++ b/src/spdx_tools/spdx3/model/licensing/conjunctive_license_set.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/licensing/custom_license.py b/src/spdx_tools/spdx3/model/licensing/custom_license.py index 773081f8d..4617a18db 100644 --- a/src/spdx_tools/spdx3/model/licensing/custom_license.py +++ b/src/spdx_tools/spdx3/model/licensing/custom_license.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/licensing/custom_license_addition.py b/src/spdx_tools/spdx3/model/licensing/custom_license_addition.py index 707a28883..b50d27770 100644 --- a/src/spdx_tools/spdx3/model/licensing/custom_license_addition.py +++ b/src/spdx_tools/spdx3/model/licensing/custom_license_addition.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/licensing/disjunctive_license_set.py b/src/spdx_tools/spdx3/model/licensing/disjunctive_license_set.py index 00d63aee7..a5ac3bdc8 100644 --- a/src/spdx_tools/spdx3/model/licensing/disjunctive_license_set.py +++ b/src/spdx_tools/spdx3/model/licensing/disjunctive_license_set.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List +from beartype.typing import List from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/licensing/license.py b/src/spdx_tools/spdx3/model/licensing/license.py index 3d1c87822..e2fd625ff 100644 --- a/src/spdx_tools/spdx3/model/licensing/license.py +++ b/src/spdx_tools/spdx3/model/licensing/license.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from abc import abstractmethod from dataclasses import field -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.spdx3.model.licensing.any_license_info import AnyLicenseInfo diff --git a/src/spdx_tools/spdx3/model/licensing/license_addition.py b/src/spdx_tools/spdx3/model/licensing/license_addition.py index cb7e7d755..e3669b5cb 100644 --- a/src/spdx_tools/spdx3/model/licensing/license_addition.py +++ b/src/spdx_tools/spdx3/model/licensing/license_addition.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from abc import ABC, abstractmethod from dataclasses import field -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties diff --git a/src/spdx_tools/spdx3/model/licensing/listed_license.py b/src/spdx_tools/spdx3/model/licensing/listed_license.py index e438ac4a0..2c0b02b3d 100644 --- a/src/spdx_tools/spdx3/model/licensing/listed_license.py +++ b/src/spdx_tools/spdx3/model/licensing/listed_license.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/licensing/listed_license_exception.py b/src/spdx_tools/spdx3/model/licensing/listed_license_exception.py index 56ddaa897..799fcedae 100644 --- a/src/spdx_tools/spdx3/model/licensing/listed_license_exception.py +++ b/src/spdx_tools/spdx3/model/licensing/listed_license_exception.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/lifecycle_scoped_relationship.py b/src/spdx_tools/spdx3/model/lifecycle_scoped_relationship.py index eccc913e9..f5181a616 100644 --- a/src/spdx_tools/spdx3/model/lifecycle_scoped_relationship.py +++ b/src/spdx_tools/spdx3/model/lifecycle_scoped_relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from datetime import datetime from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/namespace_map.py b/src/spdx_tools/spdx3/model/namespace_map.py index e87f62810..88ad49bf8 100644 --- a/src/spdx_tools/spdx3/model/namespace_map.py +++ b/src/spdx_tools/spdx3/model/namespace_map.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Optional +from beartype.typing import Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/organization.py b/src/spdx_tools/spdx3/model/organization.py index 399079560..f896b2b33 100644 --- a/src/spdx_tools/spdx3/model/organization.py +++ b/src/spdx_tools/spdx3/model/organization.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/person.py b/src/spdx_tools/spdx3/model/person.py index 266992cdf..b06e263db 100644 --- a/src/spdx_tools/spdx3/model/person.py +++ b/src/spdx_tools/spdx3/model/person.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/relationship.py b/src/spdx_tools/spdx3/model/relationship.py index 9a207add4..04550b419 100644 --- a/src/spdx_tools/spdx3/model/relationship.py +++ b/src/spdx_tools/spdx3/model/relationship.py @@ -4,7 +4,8 @@ from dataclasses import field from datetime import datetime from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/cvss_v2_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/cvss_v2_vuln_assessment_relationship.py index 2b58d6385..f480e961b 100644 --- a/src/spdx_tools/spdx3/model/security/cvss_v2_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/cvss_v2_vuln_assessment_relationship.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/cvss_v3_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/cvss_v3_vuln_assessment_relationship.py index cf3b104e0..fb30a215c 100644 --- a/src/spdx_tools/spdx3/model/security/cvss_v3_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/cvss_v3_vuln_assessment_relationship.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/epss_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/epss_vuln_assessment_relationship.py index 820e7fe52..cde6445d6 100644 --- a/src/spdx_tools/spdx3/model/security/epss_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/epss_vuln_assessment_relationship.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/exploit_catalog_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/exploit_catalog_vuln_assessment_relationship.py index fdbd8a337..6ed309047 100644 --- a/src/spdx_tools/spdx3/model/security/exploit_catalog_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/exploit_catalog_vuln_assessment_relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from datetime import datetime from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/ssvc_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/ssvc_vuln_assessment_relationship.py index 9341eb6d3..e72f6c30f 100644 --- a/src/spdx_tools/spdx3/model/security/ssvc_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/ssvc_vuln_assessment_relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from datetime import datetime from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/vex_affected_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/vex_affected_vuln_assessment_relationship.py index 152ba6c62..014190770 100644 --- a/src/spdx_tools/spdx3/model/security/vex_affected_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/vex_affected_vuln_assessment_relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/vex_fixed_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/vex_fixed_vuln_assessment_relationship.py index bddf492dd..79a495bb9 100644 --- a/src/spdx_tools/spdx3/model/security/vex_fixed_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/vex_fixed_vuln_assessment_relationship.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/vex_not_affected_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/vex_not_affected_vuln_assessment_relationship.py index 9ddb8d10c..659ea747f 100644 --- a/src/spdx_tools/spdx3/model/security/vex_not_affected_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/vex_not_affected_vuln_assessment_relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from datetime import datetime from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/vex_under_investigation_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/vex_under_investigation_vuln_assessment_relationship.py index 29edc5074..a24db0156 100644 --- a/src/spdx_tools/spdx3/model/security/vex_under_investigation_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/vex_under_investigation_vuln_assessment_relationship.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/security/vex_vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/vex_vuln_assessment_relationship.py index 342ff3fd4..8b5c0fc68 100644 --- a/src/spdx_tools/spdx3/model/security/vex_vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/vex_vuln_assessment_relationship.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from abc import abstractmethod -from typing import Optional + +from beartype.typing import Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.spdx3.model.security.vuln_assessment_relationship import VulnAssessmentRelationship diff --git a/src/spdx_tools/spdx3/model/security/vuln_assessment_relationship.py b/src/spdx_tools/spdx3/model/security/vuln_assessment_relationship.py index b97dd0c91..f20303743 100644 --- a/src/spdx_tools/spdx3/model/security/vuln_assessment_relationship.py +++ b/src/spdx_tools/spdx3/model/security/vuln_assessment_relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from abc import abstractmethod from datetime import datetime -from typing import Optional + +from beartype.typing import Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.spdx3.model import Relationship diff --git a/src/spdx_tools/spdx3/model/security/vulnerability.py b/src/spdx_tools/spdx3/model/security/vulnerability.py index bae08afe3..1daa006a6 100644 --- a/src/spdx_tools/spdx3/model/security/vulnerability.py +++ b/src/spdx_tools/spdx3/model/security/vulnerability.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/software/file.py b/src/spdx_tools/spdx3/model/software/file.py index 22918fda2..0651aaadf 100644 --- a/src/spdx_tools/spdx3/model/software/file.py +++ b/src/spdx_tools/spdx3/model/software/file.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/software/package.py b/src/spdx_tools/spdx3/model/software/package.py index 0becb4f02..2b20ba398 100644 --- a/src/spdx_tools/spdx3/model/software/package.py +++ b/src/spdx_tools/spdx3/model/software/package.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/software/sbom.py b/src/spdx_tools/spdx3/model/software/sbom.py index c720bc198..ff702953f 100644 --- a/src/spdx_tools/spdx3/model/software/sbom.py +++ b/src/spdx_tools/spdx3/model/software/sbom.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from dataclasses import field from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/software/snippet.py b/src/spdx_tools/spdx3/model/software/snippet.py index b3d955a20..4dc5ac6e3 100644 --- a/src/spdx_tools/spdx3/model/software/snippet.py +++ b/src/spdx_tools/spdx3/model/software/snippet.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/software/software_artifact.py b/src/spdx_tools/spdx3/model/software/software_artifact.py index d3dd2f9e6..582c71613 100644 --- a/src/spdx_tools/spdx3/model/software/software_artifact.py +++ b/src/spdx_tools/spdx3/model/software/software_artifact.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from abc import abstractmethod -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.spdx3.model import Artifact diff --git a/src/spdx_tools/spdx3/model/software/software_dependency_relationship.py b/src/spdx_tools/spdx3/model/software/software_dependency_relationship.py index 08cfc3d2c..1ce96aeb7 100644 --- a/src/spdx_tools/spdx3/model/software/software_dependency_relationship.py +++ b/src/spdx_tools/spdx3/model/software/software_dependency_relationship.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from datetime import datetime from enum import Enum, auto -from typing import List, Optional + +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/software_agent.py b/src/spdx_tools/spdx3/model/software_agent.py index 1b5c7292a..50fb57540 100644 --- a/src/spdx_tools/spdx3/model/software_agent.py +++ b/src/spdx_tools/spdx3/model/software_agent.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/spdx_collection.py b/src/spdx_tools/spdx3/model/spdx_collection.py index fcb05966f..65c28951a 100644 --- a/src/spdx_tools/spdx3/model/spdx_collection.py +++ b/src/spdx_tools/spdx3/model/spdx_collection.py @@ -3,7 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from abc import abstractmethod from dataclasses import field -from typing import List + +from beartype.typing import List from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.spdx3.model import Element, ExternalMap, NamespaceMap diff --git a/src/spdx_tools/spdx3/model/spdx_document.py b/src/spdx_tools/spdx3/model/spdx_document.py index effc46f23..43fcb3d6b 100644 --- a/src/spdx_tools/spdx3/model/spdx_document.py +++ b/src/spdx_tools/spdx3/model/spdx_document.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/model/tool.py b/src/spdx_tools/spdx3/model/tool.py index 40efc4514..bc8447c1f 100644 --- a/src/spdx_tools/spdx3/model/tool.py +++ b/src/spdx_tools/spdx3/model/tool.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import List, Optional +from beartype.typing import List, Optional from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties from spdx_tools.common.typing.type_checks import check_types_and_set_values diff --git a/src/spdx_tools/spdx3/payload.py b/src/spdx_tools/spdx3/payload.py index 911709a24..17bc78c91 100644 --- a/src/spdx_tools/spdx3/payload.py +++ b/src/spdx_tools/spdx3/payload.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Dict +from beartype.typing import Dict from spdx_tools.spdx3.model import Element diff --git a/src/spdx_tools/spdx3/validation/json_ld/shacl_validation.py b/src/spdx_tools/spdx3/validation/json_ld/shacl_validation.py index 07613bb6b..e7b3c8776 100644 --- a/src/spdx_tools/spdx3/validation/json_ld/shacl_validation.py +++ b/src/spdx_tools/spdx3/validation/json_ld/shacl_validation.py @@ -1,8 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import Optional - +from beartype.typing import Optional from pyshacl import validate from rdflib import Graph diff --git a/src/spdx_tools/spdx3/writer/console/agent_writer.py b/src/spdx_tools/spdx3/writer/console/agent_writer.py index cd46ff703..a1c12a9e0 100644 --- a/src/spdx_tools/spdx3/writer/console/agent_writer.py +++ b/src/spdx_tools/spdx3/writer/console/agent_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Agent, Organization, Person, SoftwareAgent from spdx_tools.spdx3.writer.console.element_writer import write_element_properties diff --git a/src/spdx_tools/spdx3/writer/console/ai/ai_package_writer.py b/src/spdx_tools/spdx3/writer/console/ai/ai_package_writer.py index 0cebdf4f4..025ae613a 100644 --- a/src/spdx_tools/spdx3/writer/console/ai/ai_package_writer.py +++ b/src/spdx_tools/spdx3/writer/console/ai/ai_package_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.ai import AIPackage from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/annotation_writer.py b/src/spdx_tools/spdx3/writer/console/annotation_writer.py index 8f5ce6c1d..3261a69bd 100644 --- a/src/spdx_tools/spdx3/writer/console/annotation_writer.py +++ b/src/spdx_tools/spdx3/writer/console/annotation_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Annotation from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/artifact_writer.py b/src/spdx_tools/spdx3/writer/console/artifact_writer.py index 13467f289..f55d29e05 100644 --- a/src/spdx_tools/spdx3/writer/console/artifact_writer.py +++ b/src/spdx_tools/spdx3/writer/console/artifact_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Artifact from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/bom_writer.py b/src/spdx_tools/spdx3/writer/console/bom_writer.py index c6e0f71ec..04fcb283d 100644 --- a/src/spdx_tools/spdx3/writer/console/bom_writer.py +++ b/src/spdx_tools/spdx3/writer/console/bom_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Bom from spdx_tools.spdx3.writer.console.bundle_writer import write_bundle diff --git a/src/spdx_tools/spdx3/writer/console/build/build_writer.py b/src/spdx_tools/spdx3/writer/console/build/build_writer.py index 77c3d47f7..3edc9c6fb 100644 --- a/src/spdx_tools/spdx3/writer/console/build/build_writer.py +++ b/src/spdx_tools/spdx3/writer/console/build/build_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.build import Build from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/bundle_writer.py b/src/spdx_tools/spdx3/writer/console/bundle_writer.py index 2a7fc8d78..5930db5ee 100644 --- a/src/spdx_tools/spdx3/writer/console/bundle_writer.py +++ b/src/spdx_tools/spdx3/writer/console/bundle_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Bundle from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/console.py b/src/spdx_tools/spdx3/writer/console/console.py index 30bf024da..a2ec81ed5 100644 --- a/src/spdx_tools/spdx3/writer/console/console.py +++ b/src/spdx_tools/spdx3/writer/console/console.py @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 from enum import Enum -from typing import Optional, TextIO, Union + +from beartype.typing import Optional, TextIO, Union def write_value(tag: str, value: Optional[Union[bool, str, dict, list, Enum]], out: TextIO, indent: bool = False): diff --git a/src/spdx_tools/spdx3/writer/console/creation_info_writer.py b/src/spdx_tools/spdx3/writer/console/creation_info_writer.py index 3f357f677..c91e6781d 100644 --- a/src/spdx_tools/spdx3/writer/console/creation_info_writer.py +++ b/src/spdx_tools/spdx3/writer/console/creation_info_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import CreationInfo from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/dataset/dataset_writer.py b/src/spdx_tools/spdx3/writer/console/dataset/dataset_writer.py index 363ef71fb..91131240a 100644 --- a/src/spdx_tools/spdx3/writer/console/dataset/dataset_writer.py +++ b/src/spdx_tools/spdx3/writer/console/dataset/dataset_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.dataset import Dataset from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/element_writer.py b/src/spdx_tools/spdx3/writer/console/element_writer.py index c790de6bd..6614279f1 100644 --- a/src/spdx_tools/spdx3/writer/console/element_writer.py +++ b/src/spdx_tools/spdx3/writer/console/element_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Element from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/external_identifier_writer.py b/src/spdx_tools/spdx3/writer/console/external_identifier_writer.py index 90327b9e9..40f2d0e97 100644 --- a/src/spdx_tools/spdx3/writer/console/external_identifier_writer.py +++ b/src/spdx_tools/spdx3/writer/console/external_identifier_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import ExternalIdentifier from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/external_map_writer.py b/src/spdx_tools/spdx3/writer/console/external_map_writer.py index 1b53a1024..41f59dc5d 100644 --- a/src/spdx_tools/spdx3/writer/console/external_map_writer.py +++ b/src/spdx_tools/spdx3/writer/console/external_map_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import ExternalMap from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/external_reference_writer.py b/src/spdx_tools/spdx3/writer/console/external_reference_writer.py index 7deb0b620..fa6cc79eb 100644 --- a/src/spdx_tools/spdx3/writer/console/external_reference_writer.py +++ b/src/spdx_tools/spdx3/writer/console/external_reference_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import ExternalReference from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/hash_writer.py b/src/spdx_tools/spdx3/writer/console/hash_writer.py index b3a722daa..970a49b56 100644 --- a/src/spdx_tools/spdx3/writer/console/hash_writer.py +++ b/src/spdx_tools/spdx3/writer/console/hash_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Hash from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/integrity_method_writer.py b/src/spdx_tools/spdx3/writer/console/integrity_method_writer.py index 2e3d4dfe5..df233c997 100644 --- a/src/spdx_tools/spdx3/writer/console/integrity_method_writer.py +++ b/src/spdx_tools/spdx3/writer/console/integrity_method_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import IntegrityMethod from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/lifecycle_scoped_relationship_writer.py b/src/spdx_tools/spdx3/writer/console/lifecycle_scoped_relationship_writer.py index e71ab6b9f..5710ae6e8 100644 --- a/src/spdx_tools/spdx3/writer/console/lifecycle_scoped_relationship_writer.py +++ b/src/spdx_tools/spdx3/writer/console/lifecycle_scoped_relationship_writer.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import LifecycleScopedRelationship from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/namespace_map_writer.py b/src/spdx_tools/spdx3/writer/console/namespace_map_writer.py index 8eeed3efe..d83ccb05a 100644 --- a/src/spdx_tools/spdx3/writer/console/namespace_map_writer.py +++ b/src/spdx_tools/spdx3/writer/console/namespace_map_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import NamespaceMap from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/payload_writer.py b/src/spdx_tools/spdx3/writer/console/payload_writer.py index 95ea3f21a..34532f364 100644 --- a/src/spdx_tools/spdx3/writer/console/payload_writer.py +++ b/src/spdx_tools/spdx3/writer/console/payload_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import ( Annotation, diff --git a/src/spdx_tools/spdx3/writer/console/relationship_writer.py b/src/spdx_tools/spdx3/writer/console/relationship_writer.py index c30f89a63..1a8b16a3e 100644 --- a/src/spdx_tools/spdx3/writer/console/relationship_writer.py +++ b/src/spdx_tools/spdx3/writer/console/relationship_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Relationship from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/software/file_writer.py b/src/spdx_tools/spdx3/writer/console/software/file_writer.py index d76ca46b6..ec631f024 100644 --- a/src/spdx_tools/spdx3/writer/console/software/file_writer.py +++ b/src/spdx_tools/spdx3/writer/console/software/file_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.software import File from spdx_tools.spdx3.writer.console.artifact_writer import write_artifact_properties diff --git a/src/spdx_tools/spdx3/writer/console/software/package_writer.py b/src/spdx_tools/spdx3/writer/console/software/package_writer.py index 83905de55..1f66f989b 100644 --- a/src/spdx_tools/spdx3/writer/console/software/package_writer.py +++ b/src/spdx_tools/spdx3/writer/console/software/package_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.software import Package from spdx_tools.spdx3.writer.console.artifact_writer import write_artifact_properties diff --git a/src/spdx_tools/spdx3/writer/console/software/sbom_writer.py b/src/spdx_tools/spdx3/writer/console/software/sbom_writer.py index 039d55cc2..2e34a6b00 100644 --- a/src/spdx_tools/spdx3/writer/console/software/sbom_writer.py +++ b/src/spdx_tools/spdx3/writer/console/software/sbom_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.software import Sbom from spdx_tools.spdx3.writer.console.bom_writer import write_bom diff --git a/src/spdx_tools/spdx3/writer/console/software/snippet_writer.py b/src/spdx_tools/spdx3/writer/console/software/snippet_writer.py index 19b7c6a27..b0ea7bbc7 100644 --- a/src/spdx_tools/spdx3/writer/console/software/snippet_writer.py +++ b/src/spdx_tools/spdx3/writer/console/software/snippet_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.software import Snippet from spdx_tools.spdx3.writer.console.artifact_writer import write_artifact_properties diff --git a/src/spdx_tools/spdx3/writer/console/software/software_dependency_relationship_writer.py b/src/spdx_tools/spdx3/writer/console/software/software_dependency_relationship_writer.py index e05599525..8064c76a1 100644 --- a/src/spdx_tools/spdx3/writer/console/software/software_dependency_relationship_writer.py +++ b/src/spdx_tools/spdx3/writer/console/software/software_dependency_relationship_writer.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model.software import SoftwareDependencyRelationship from spdx_tools.spdx3.writer.console.console import write_value diff --git a/src/spdx_tools/spdx3/writer/console/spdx_collection_writer.py b/src/spdx_tools/spdx3/writer/console/spdx_collection_writer.py index 242cae7bb..7654329b2 100644 --- a/src/spdx_tools/spdx3/writer/console/spdx_collection_writer.py +++ b/src/spdx_tools/spdx3/writer/console/spdx_collection_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import ElementCollection from spdx_tools.spdx3.writer.console.element_writer import write_element_properties diff --git a/src/spdx_tools/spdx3/writer/console/spdx_document_writer.py b/src/spdx_tools/spdx3/writer/console/spdx_document_writer.py index 15f3e57f7..8c2cdf649 100644 --- a/src/spdx_tools/spdx3/writer/console/spdx_document_writer.py +++ b/src/spdx_tools/spdx3/writer/console/spdx_document_writer.py @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 spdx contributors # # SPDX-License-Identifier: Apache-2.0 -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import SpdxDocument from spdx_tools.spdx3.writer.console.bundle_writer import write_bundle diff --git a/src/spdx_tools/spdx3/writer/console/tool_writer.py b/src/spdx_tools/spdx3/writer/console/tool_writer.py index 35824a778..23eeb6a1a 100644 --- a/src/spdx_tools/spdx3/writer/console/tool_writer.py +++ b/src/spdx_tools/spdx3/writer/console/tool_writer.py @@ -8,7 +8,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TextIO +from beartype.typing import TextIO from spdx_tools.spdx3.model import Tool from spdx_tools.spdx3.writer.console.element_writer import write_element_properties diff --git a/src/spdx_tools/spdx3/writer/json_ld/json_ld_converter.py b/src/spdx_tools/spdx3/writer/json_ld/json_ld_converter.py index ff6f9f1a6..865053b71 100644 --- a/src/spdx_tools/spdx3/writer/json_ld/json_ld_converter.py +++ b/src/spdx_tools/spdx3/writer/json_ld/json_ld_converter.py @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from datetime import datetime from enum import Enum -from typing import Any, List +from beartype.typing import Any, List from semantic_version import Version from spdx_tools.spdx3.model.creation_info import CreationInfo