Skip to content

Commit e78e7b1

Browse files
committed
fixes mypy
1 parent 9c673b2 commit e78e7b1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/settings-library/src/settings_library/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _is_auto_default_from_env_enabled(field: FieldInfo) -> bool:
5858
)
5959

6060

61-
ENABLED: Final = {}
61+
_MARKED_AS_UNSET: Final[dict] = {}
6262

6363

6464
class EnvSettingsWithAutoDefaultSource(EnvSettingsSource):
@@ -89,7 +89,7 @@ def prepare_field_value(
8989
_is_auto_default_from_env_enabled(field)
9090
and field.default_factory
9191
and field.default is None
92-
and prepared_value == ENABLED
92+
and prepared_value == _MARKED_AS_UNSET
9393
):
9494
prepared_value = field.default_factory()
9595
return prepared_value

packages/settings-library/src/settings_library/basic_types.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
from enum import Enum
12
from typing import Annotated, TypeAlias
23

34
from common_library.basic_types import BootModeEnum, BuildTargetEnum, LogLevel
45
from pydantic import Field, StringConstraints
56

6-
assert LogLevel # nosec
7-
assert BootModeEnum # nosec
8-
assert BuildTargetEnum # nosec
7+
assert issubclass(LogLevel, Enum) # nosec
8+
assert issubclass(BootModeEnum, Enum) # nosec
9+
assert issubclass(BuildTargetEnum, Enum) # nosec
910

1011
__all__: tuple[str, ...] = (
1112
"LogLevel",

0 commit comments

Comments
 (0)