Skip to content

Commit

Permalink
fix: mock on subclass __parameters__
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskrt committed Jun 10, 2024
1 parent 301b0cd commit 758c6d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gt4sd/algorithms/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from dataclasses import dataclass as vanilla_dataclass
from dataclasses import field, make_dataclass
from functools import WRAPPER_ASSIGNMENTS, update_wrapper
from typing import Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Type
from typing import Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Type, TypeVar

import pydantic

Expand Down Expand Up @@ -186,8 +186,7 @@ def decorator(
], # type: ignore
)
# NOTE: Needed to circumvent a pydantic TypeError: Parameter list to Generic[...] cannot be empty
VanillaConfiguration.__pydantic_validator__ = True # type: ignore

VanillaConfiguration.__parameters__ = (TypeVar('T'),)
# NOTE: Duplicate call necessary for pydantic >=1.10.* - see https://github.com/pydantic/pydantic/issues/4695
PydanticConfiguration: Type[AlgorithmConfiguration] = dataclass( # type: ignore
VanillaConfiguration
Expand Down

0 comments on commit 758c6d8

Please sign in to comment.