Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies.py: use Enum rather than StrEnum for DependencyKind #46

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pym/gentoolkit/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import itertools
from functools import cache
from enum import StrEnum
from enum import Enum
from typing import List, Dict

import portage
Expand All @@ -28,7 +28,7 @@
# =======


class DependencyKind(StrEnum):
class DependencyKind(Enum):
DEPEND = "DEPEND"
RDEPEND = "RDEPEND"
BDEPEND = "BDEPEND"
Expand Down Expand Up @@ -104,13 +104,13 @@ def _get_depend(self, env_vars, raw=False):

@cache
def get_raw_depends(self) -> str:
return self._get_depend([depkind for depkind in DependencyKind], raw=True)
return self._get_depend([depkind.value for depkind in DependencyKind], raw=True)

@cache
def get_depends(self) -> Dict[DependencyKind, List[Atom]]:
depends = dict()
for depkind in DependencyKind:
depend = self._get_depend([depkind])
depend = self._get_depend([depkind.value])
depends[depkind] = depend
return depends

Expand Down
Loading