From 78464ec40bad9a0f824b063506f58296cc3ed9f3 Mon Sep 17 00:00:00 2001 From: John Turner Date: Wed, 24 Jan 2024 18:31:11 -0500 Subject: dependencies.py: create DependencyKind enum The DependencyKind enum allows iterating over the different dependency kinds and represents each dependency kind as a type. This could later be used in APIs for selecting specific dependency kinds in queries. Signed-off-by: John Turner Signed-off-by: Sam James --- pym/gentoolkit/dependencies.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py index 8dd4867..dd30312 100644 --- a/pym/gentoolkit/dependencies.py +++ b/pym/gentoolkit/dependencies.py @@ -11,6 +11,8 @@ __all__ = ("Dependencies",) # Imports # ======= +from enum import StrEnum + import portage from portage.dep import paren_reduce @@ -24,6 +26,14 @@ from gentoolkit.query import Query # ======= +class DependencyKind(StrEnum): + DEPEND = "DEPEND" + RDEPEND = "RDEPEND" + BDEPEND = "BDEPEND" + PDEPEND = "PDEPEND" + IDEPEND = "IDEPEND" + + class Dependencies(Query): """Access a package's dependencies and reverse dependencies. -- cgit v1.2.3-65-gdbad