From 5cbfdc855129f43a14e774dfb6271b71c2b62116 Mon Sep 17 00:00:00 2001 From: Kevin De Pelseneer Date: Fri, 8 Nov 2024 16:12:25 +0100 Subject: [PATCH] Fix enum problem Since python 3.11 'only-string' enums have to be called StrEnums or you need to call `.value` on each member. See https://docs.python.org/3/library/enum.html#enum.StrEnum for documentation --- mars-cli/mars_lib/target_repo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mars-cli/mars_lib/target_repo.py b/mars-cli/mars_lib/target_repo.py index 4902616..6d90cd4 100644 --- a/mars-cli/mars_lib/target_repo.py +++ b/mars-cli/mars_lib/target_repo.py @@ -1,10 +1,10 @@ -from enum import Enum +from enum import StrEnum TARGET_REPO_KEY = "target_repository" -class TargetRepository(str, Enum): +class TargetRepository(StrEnum): """ Holds constants, tied to the target repositories. """ @@ -17,4 +17,4 @@ class TargetRepository(str, Enum): @classmethod def available_repositories(cls): - return {item.value for item in cls} + return {item for item in cls}