diff options
author | 2024-01-24 18:31:11 -0500 | |
---|---|---|
committer | 2024-02-16 20:12:48 +0000 | |
commit | 78464ec40bad9a0f824b063506f58296cc3ed9f3 (patch) | |
tree | 6ea18288f699ddd16ff7b857944500eb6fee048e | |
parent | eclean: handle when git3-src doesn't exist (port to Pathlib) (diff) | |
download | gentoolkit-78464ec40bad9a0f824b063506f58296cc3ed9f3.tar.gz gentoolkit-78464ec40bad9a0f824b063506f58296cc3ed9f3.tar.bz2 gentoolkit-78464ec40bad9a0f824b063506f58296cc3ed9f3.zip |
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 <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | pym/gentoolkit/dependencies.py | 10 |
1 files changed, 10 insertions, 0 deletions
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. |