3131from typing import Any , Optional , Union
3232from urllib .parse import quote as url_quote
3333from uuid import UUID
34- from warnings import warn
34+ from warnings import warn , deprecated
3535from xml .etree .ElementTree import Element as XmlElement # nosec B405
3636
3737import py_serializable as serializable
3838from sortedcontainers import SortedSet
3939
40- from contrib .hash .factories import HashTypeFactory
4140from .._internal .compare import ComparableTuple as _ComparableTuple
4241from ..exception .model import InvalidLocaleTypeException , InvalidUriException
4342from ..exception .serialization import CycloneDxDeserializationException , SerializationOfUnexpectedValueException
@@ -377,6 +376,7 @@ class HashType:
377376 """
378377
379378 @staticmethod
379+ @deprecated ('Deprecated - use cyclonedx.contrib.hash.factories.HashTypeFactory.from_hashlib_alg instead' )
380380 def from_hashlib_alg (hashlib_alg : str , content : str ) -> 'HashType' :
381381 """Deprecated — Alias of :func:`cyclonedx.contrib.hash.factories.HashTypeFactory.from_hashlib_alge`.
382382
@@ -385,9 +385,12 @@ def from_hashlib_alg(hashlib_alg: str, content: str) -> 'HashType':
385385 .. deprecated:: next
386386 Use ``cyclonedx.contrib.hash.factories.HashTypeFactory.from_hashlib_alg()`` instead.
387387 """
388+ from ..contrib .hash .factories import HashTypeFactory
389+
388390 return HashTypeFactory ().from_hashlib_alg (hashlib_alg , content )
389391
390392 @staticmethod
393+ @deprecated ('Deprecated - use cyclonedx.contrib.hash.factories.HashTypeFactory.from_composite_str instead' )
391394 def from_composite_str (composite_hash : str ) -> 'HashType' :
392395 """Deprecated — Alias of :func:`cyclonedx.contrib.hash.factories.HashTypeFactory.from_composite_str`.
393396
@@ -397,6 +400,8 @@ def from_composite_str(composite_hash: str) -> 'HashType':
397400 .. deprecated:: next
398401 Use ``cyclonedx.contrib.hash.factories.HashTypeFactory.from_composite_str()`` instead.
399402 """
403+ from ..contrib .hash .factories import HashTypeFactory
404+
400405 return HashTypeFactory ().from_composite_str (composite_hash )
401406
402407 def __init__ (
0 commit comments