cyclonedx.schema.deprecation
This module provides warning classes for deprecated features in CycloneDX schemas. Each warning class corresponds to a specific schema version, enabling downstream code to catch, filter, or otherwise handle schema-specific deprecation warnings.
Intended Usage
Downstream consumers can manage warnings using Python’s warnings module.
Common scenarios include:
Filtering by schema version
Suppressing warnings in tests or batch processing
Logging or reporting deprecation warnings without raising exceptions
Example
import warnings
from cyclonedx.schema.deprecation import (
BaseSchemaDeprecationWarning,
SchemaDeprecationWarning1Dot7,
)
# Suppress all CycloneDX schema deprecation warnings
warnings.filterwarnings("ignore", category=BaseSchemaDeprecationWarning)
# Suppress only warnings specific to schema version 1.7
warnings.filterwarnings("ignore", category=SchemaDeprecationWarning1Dot7)
Notes
All deprecation warnings inherit from
BaseSchemaDeprecationWarning.The
SCHEMA_VERSIONclass variable indicates the CycloneDX schema version where the feature became deprecated.These warning classes are designed for downstream filtering and logging, not for raising exceptions.
Exceptions
Base class for warnings about deprecated schema features. |
|
Class for warnings about deprecated schema features in CycloneDX 1.7 |
|
Class for warnings about deprecated schema features in CycloneDX 1.6 |
|
Class for warnings about deprecated schema features in CycloneDX 1.5 |
|
Class for warnings about deprecated schema features in CycloneDX 1.4 |
|
Class for warnings about deprecated schema features in CycloneDX 1.3 |
|
Class for warnings about deprecated schema features in CycloneDX 1.2 |
|
Class for warnings about deprecated schema features in CycloneDX 1.1 |
Module Contents
- exception cyclonedx.schema.deprecation.BaseSchemaDeprecationWarning
Bases:
DeprecationWarning,abc.ABCBase class for warnings about deprecated schema features.
- SCHEMA_VERSION: ClassVar[cyclonedx.schema.SchemaVersion]
- exception cyclonedx.schema.deprecation.SchemaDeprecationWarning1Dot7
Bases:
BaseSchemaDeprecationWarningClass for warnings about deprecated schema features in CycloneDX 1.7
- SCHEMA_VERSION: ClassVar[Literal[cyclonedx.schema.SchemaVersion.V1_7]]
- exception cyclonedx.schema.deprecation.SchemaDeprecationWarning1Dot6
Bases:
BaseSchemaDeprecationWarningClass for warnings about deprecated schema features in CycloneDX 1.6
- SCHEMA_VERSION: ClassVar[Literal[cyclonedx.schema.SchemaVersion.V1_6]]
- exception cyclonedx.schema.deprecation.SchemaDeprecationWarning1Dot5
Bases:
BaseSchemaDeprecationWarningClass for warnings about deprecated schema features in CycloneDX 1.5
- SCHEMA_VERSION: ClassVar[Literal[cyclonedx.schema.SchemaVersion.V1_5]]
- exception cyclonedx.schema.deprecation.SchemaDeprecationWarning1Dot4
Bases:
BaseSchemaDeprecationWarningClass for warnings about deprecated schema features in CycloneDX 1.4
- SCHEMA_VERSION: ClassVar[Literal[cyclonedx.schema.SchemaVersion.V1_4]]
- exception cyclonedx.schema.deprecation.SchemaDeprecationWarning1Dot3
Bases:
BaseSchemaDeprecationWarningClass for warnings about deprecated schema features in CycloneDX 1.3
- SCHEMA_VERSION: ClassVar[Literal[cyclonedx.schema.SchemaVersion.V1_3]]
- exception cyclonedx.schema.deprecation.SchemaDeprecationWarning1Dot2
Bases:
BaseSchemaDeprecationWarningClass for warnings about deprecated schema features in CycloneDX 1.2
- SCHEMA_VERSION: ClassVar[Literal[cyclonedx.schema.SchemaVersion.V1_2]]
- exception cyclonedx.schema.deprecation.SchemaDeprecationWarning1Dot1
Bases:
BaseSchemaDeprecationWarningClass for warnings about deprecated schema features in CycloneDX 1.1
- SCHEMA_VERSION: ClassVar[Literal[cyclonedx.schema.SchemaVersion.V1_1]]