From d7e4bd9e33f958595464ca78c64a485dbed109f0 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 15 Mar 2026 16:34:30 +0100 Subject: [PATCH] cmds.projects.BaseCmdPkgRelations: Support --hide-self To support the pkg-install-testbuild-deps target, a selector is needed listing all prerequisites to be installed except the project under test. --hide-self should be useful for that. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py b/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py index 8f36ff9f..d92a75ab 100644 --- a/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py +++ b/src/python/jw/pkg/cmds/projects/BaseCmdPkgRelations.py @@ -32,6 +32,7 @@ class BaseCmdPkgRelations(Cmd): ignore: set[str] = set(), quote: bool = False, skip_excluded: bool = False, + hide_self = False, ) -> list[str]: if subsections is None: @@ -122,6 +123,8 @@ class BaseCmdPkgRelations(Cmd): case _: raise NotImplementedError(f'Expanding SemVer range "{dep[0]} {dep[1]} {dep[3]}" is not yet implemented') for expanded_dep in expanded_deps: + if hide_self and dep_name in modules: + continue match syntax: case self.Syntax.semver: pass @@ -158,6 +161,7 @@ class BaseCmdPkgRelations(Cmd): ignore = set(args.ignore.split(',')), quote = args.quote, skip_excluded = args.skip_excluded, + hide_self = args.hide_self, ) ) @@ -190,6 +194,8 @@ class BaseCmdPkgRelations(Cmd): 'should be ignored together with their dependencies') parser.add_argument('--skip-excluded', action='store_true', default=False, help='Don\'t consider or output modules matching the os cascade in their [build].exclude config') + parser.add_argument('--hide-self', action='store_true', default=False, + help='Don\'t include any of the projects listed in in the output') parser.add_argument('--quote', action='store_true', default=False, help='Put double quotes around each listed dependency')