diff --git a/setup.py b/setup.py index bd8015d9..5ed6271e 100644 --- a/setup.py +++ b/setup.py @@ -72,6 +72,7 @@ "eth-pydantic-types", # Use same version as eth-ape "pydantic_settings", # Use same version as eth-ape "taskiq[metrics]>=0.10.4,<0.11.0", + "backports.strenum ; python_version<'3.11'", ], entry_points={ "console_scripts": ["silverback=silverback._cli:cli"], diff --git a/silverback/types.py b/silverback/types.py index 70a42891..c6c19b86 100644 --- a/silverback/types.py +++ b/silverback/types.py @@ -7,11 +7,7 @@ from enum import StrEnum # Only Python 3.11+ except ImportError: - from enum import Enum - - class StrEnum(str, Enum): # type: ignore[no-redef] - def __str__(self) -> str: - return self.value + from backports.strenum import StrEnum # type: ignore[no-redef] class TaskType(StrEnum):