Skip to content

Commit

Permalink
fix breaking changes to new str-enum mixin behaviour in Py3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarloromeo committed Aug 16, 2024
1 parent cdb3c75 commit 2be8b05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/models-library/src/models_library/basic_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
from enum import Enum
from enum import StrEnum
from typing import TypeAlias

from pydantic import (
Expand Down Expand Up @@ -116,14 +116,14 @@ class HttpUrlWithCustomMinLength(HttpUrl):
min_length = 0


class LogLevel(str, Enum):
class LogLevel(StrEnum):
DEBUG = "DEBUG"
INFO = "INFO"
WARNING = "WARNING"
ERROR = "ERROR"


class BootModeEnum(str, Enum):
class BootModeEnum(StrEnum):
"""
Values taken by SC_BOOT_MODE environment variable
set in Dockerfile and used during docker/boot.sh
Expand All @@ -140,7 +140,7 @@ def is_devel_mode(self) -> bool:
return self in (self.DEBUG, self.DEVELOPMENT, self.LOCAL)


class BuildTargetEnum(str, Enum):
class BuildTargetEnum(StrEnum):
"""
Values taken by SC_BUILD_TARGET environment variable
set in Dockerfile that defines the stage targeted in the
Expand Down
4 changes: 2 additions & 2 deletions packages/settings-library/src/settings_library/r_clone.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from enum import Enum
from enum import StrEnum

from pydantic import Field, NonNegativeInt

from .base import BaseCustomSettings
from .s3 import S3Settings


class S3Provider(str, Enum):
class S3Provider(StrEnum):
AWS = "AWS"
CEPH = "CEPH"
MINIO = "MINIO"
Expand Down
2 changes: 1 addition & 1 deletion services/director-v2/tests/unit/test_core_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


def _get_backend_type_options() -> set[str]:
return {x.value for x in S3Provider if not x.startswith("_")}
return {x for x in S3Provider if not x.startswith("_")}


def test_supported_backends_did_not_change() -> None:
Expand Down

0 comments on commit 2be8b05

Please sign in to comment.