Skip to content

Commit 554e77e

Browse files
committed
docs
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 5b381fb commit 554e77e

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

cyclonedx/schema/deprecation.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Copyright (c) OWASP Foundation. All Rights Reserved.
1717

1818
from abc import ABC
19-
from typing import ClassVar, Optional
19+
from typing import ClassVar, Optional, Literal
2020
from warnings import warn
2121

2222
from . import SchemaVersion
@@ -49,34 +49,33 @@ def _warn(cls, deprecated: str, instead: Optional[str] = None,
4949

5050
class DeprecationWarning1Dot7(SchemaDeprecationWarning):
5151
"""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
5453

5554
class DeprecationWarning1Dot6(SchemaDeprecationWarning):
5655
"""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
5857

5958

6059
class DeprecationWarning1Dot5(SchemaDeprecationWarning):
6160
"""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
6362

6463

6564
class DeprecationWarning1Dot4(SchemaDeprecationWarning):
6665
"""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
6867

6968

7069
class DeprecationWarning1Dot3(SchemaDeprecationWarning):
7170
"""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
7372

7473

7574
class DeprecationWarning1Dot2(SchemaDeprecationWarning):
7675
"""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
7877

7978

8079
class DeprecationWarning1Dot1(SchemaDeprecationWarning):
8180
"""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

Comments
 (0)