|
16 | 16 | # Copyright (c) OWASP Foundation. All Rights Reserved. |
17 | 17 |
|
18 | 18 | from abc import ABC |
19 | | -from typing import ClassVar, Optional |
| 19 | +from typing import ClassVar, Optional, Literal |
20 | 20 | from warnings import warn |
21 | 21 |
|
22 | 22 | from . import SchemaVersion |
@@ -49,34 +49,33 @@ def _warn(cls, deprecated: str, instead: Optional[str] = None, |
49 | 49 |
|
50 | 50 | class DeprecationWarning1Dot7(SchemaDeprecationWarning): |
51 | 51 | """Class for warnings about deprecated schema features in CycloneDX 1.7""" |
52 | | - SCHEMA_VERSION = SchemaVersion.V1_7 |
53 | | - |
| 52 | + SCHEMA_VERSION: ClassVar[Literal[SchemaVersion.V1_7]] = SchemaVersion.V1_7 |
54 | 53 |
|
55 | 54 | class DeprecationWarning1Dot6(SchemaDeprecationWarning): |
56 | 55 | """Class for warnings about deprecated schema features in CycloneDX 1.6""" |
57 | | - SCHEMA_VERSION = SchemaVersion.V1_6 |
| 56 | + SCHEMA_VERSION: ClassVar[Literal[SchemaVersion.V1_6]] = SchemaVersion.V1_6 |
58 | 57 |
|
59 | 58 |
|
60 | 59 | class DeprecationWarning1Dot5(SchemaDeprecationWarning): |
61 | 60 | """Class for warnings about deprecated schema features in CycloneDX 1.5""" |
62 | | - SCHEMA_VERSION = SchemaVersion.V1_5 |
| 61 | + SCHEMA_VERSION: ClassVar[Literal[SchemaVersion.V1_5]] = SchemaVersion.V1_5 |
63 | 62 |
|
64 | 63 |
|
65 | 64 | class DeprecationWarning1Dot4(SchemaDeprecationWarning): |
66 | 65 | """Class for warnings about deprecated schema features in CycloneDX 1.4""" |
67 | | - SCHEMA_VERSION = SchemaVersion.V1_4 |
| 66 | + SCHEMA_VERSION: ClassVar[Literal[SchemaVersion.V1_4]] = SchemaVersion.V1_4 |
68 | 67 |
|
69 | 68 |
|
70 | 69 | class DeprecationWarning1Dot3(SchemaDeprecationWarning): |
71 | 70 | """Class for warnings about deprecated schema features in CycloneDX 1.3""" |
72 | | - SCHEMA_VERSION = SchemaVersion.V1_3 |
| 71 | + SCHEMA_VERSION: ClassVar[Literal[SchemaVersion.V1_3]] = SchemaVersion.V1_3 |
73 | 72 |
|
74 | 73 |
|
75 | 74 | class DeprecationWarning1Dot2(SchemaDeprecationWarning): |
76 | 75 | """Class for warnings about deprecated schema features in CycloneDX 1.2""" |
77 | | - _schema_version_enum = SchemaVersion.V1_2 |
| 76 | + SCHEMA_VERSION: ClassVar[Literal[SchemaVersion.V1_2]] = SchemaVersion.V1_2 |
78 | 77 |
|
79 | 78 |
|
80 | 79 | class DeprecationWarning1Dot1(SchemaDeprecationWarning): |
81 | 80 | """Class for warnings about deprecated schema features in CycloneDX 1.1""" |
82 | | - _schema_version_enum = SchemaVersion.V1_1 |
| 81 | + SCHEMA_VERSION: ClassVar[Literal[SchemaVersion.V1_1]] = SchemaVersion.V1_1 |
0 commit comments