Skip to content

Commit

Permalink
Remove old code paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rsokl committed Jan 2, 2025
1 parent 163249b commit 880efde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
10 changes: 1 addition & 9 deletions src/hydra_zen/structured_configs/_implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
from hydra_zen._compatibility import (
HYDRA_SUPPORTED_PRIMITIVE_TYPES,
HYDRA_SUPPORTED_PRIMITIVES,
OMEGACONF_VERSION,
ZEN_SUPPORTED_PRIMITIVES,
Version,
)
from hydra_zen.errors import (
HydraZenDeprecationWarning,
Expand Down Expand Up @@ -831,12 +829,6 @@ def _sanitized_type(
nested=nested,
)

if OMEGACONF_VERSION < Version(2, 2, 3): # pragma: no cover
try:
type_ = {list: List, tuple: Tuple, dict: Dict}.get(type_, type_)
except TypeError:
pass

# Warning: mutating `type_` will mutate the signature being inspected
# Even calling deepcopy(`type_`) silently fails to prevent this.
origin = get_origin(type_)
Expand Down Expand Up @@ -912,7 +904,7 @@ def _sanitized_type(
#
# Otherwise we preserve the annotation as accurately as possible
if not args:
return Any if OMEGACONF_VERSION < (2, 2, 3) else tuple
return tuple

args = cast(tuple[type, ...], args)
unique_args = set(args)
Expand Down
13 changes: 4 additions & 9 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@
)

from hydra_zen import DefaultBuilds, builds, instantiate, mutable_value
from hydra_zen._compatibility import (
HYDRA_VERSION,
OMEGACONF_VERSION,
Version,
_get_version,
)
from hydra_zen._compatibility import HYDRA_VERSION, Version, _get_version
from hydra_zen.structured_configs._utils import (
StrictDataclassOptions,
field,
Expand Down Expand Up @@ -152,9 +147,9 @@ class SomeProtocol(Protocol[T]): # type: ignore
(C, Any), # unsupported primitives
(type(None), Any),
(set, Any),
(list, (List if OMEGACONF_VERSION < Version(2, 2, 3) else list)),
(tuple, (Any if OMEGACONF_VERSION < Version(2, 2, 3) else tuple)),
(dict, (Dict if OMEGACONF_VERSION < Version(2, 2, 3) else dict)),
(list, list),
(tuple, tuple),
(dict, dict),
(callable, Any),
(frozenset, Any),
(List, list),
Expand Down

0 comments on commit 880efde

Please sign in to comment.