Skip to content

Fix/improve dependency handling#65

Merged
Urist-McGit merged 1 commit intosiemens:mainfrom
tamilari:fix/improveDependencyHandling
Oct 13, 2025
Merged

Fix/improve dependency handling#65
Urist-McGit merged 1 commit intosiemens:mainfrom
tamilari:fix/improveDependencyHandling

Conversation

@tamilari
Copy link
Contributor

@tamilari tamilari commented Oct 8, 2025

  • Show the download, source-merge, and repack commands in the help
    message, even if the dependencies are not installed. This ensures
    consistency across all systems
  • Display a missing dependency error message when an unavailable command
    is used
  • Require one of the four commands to be specified so that calling
    debsbom alone will display a usage error message
  • Always import Compression from .util, regardless of whether the
    download dependencies are installed. This ensures that the parser is
    always set up with the correct compression options and results in
    consistent help messages

@fmoessbauer
Copy link
Member

Hi @tamilari,

please rebase this PR against the latest main branch, as we don't do merge commits in this project. Once done, please just force-push.

@tamilari tamilari force-pushed the fix/improveDependencyHandling branch 2 times, most recently from 34fc794 to 2a1ac77 Compare October 8, 2025 08:56
@Urist-McGit
Copy link
Collaborator

CI is not working right now. Once #68 is merged, please rebase and I should be able to approve you.

@tamilari tamilari force-pushed the fix/improveDependencyHandling branch 2 times, most recently from 2fb5990 to 6c8250c Compare October 8, 2025 11:52
Copy link
Member

@fmoessbauer fmoessbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding commit fix/improve missing dependency handling :

Please change the message to follow the conventional commits style.

if args.cmd == "generate":
GenerateCmd.run(args)
elif not HAS_DOWNLOAD_DEPS:
print(f"{MISSING_MODULE}. {args.cmd} not available", file=sys.stderr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the logger.error command for that to pass the message through the logging module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative is to just throw a runtime error here which is then catched in the error handler. By that, you can avoid the explicit sys.exit(-1).

@tamilari tamilari force-pushed the fix/improveDependencyHandling branch from 1aa69e2 to 8f7fcf6 Compare October 9, 2025 13:02
- Show the download, source-merge, and repack commands in the help
  message, even if the dependencies are not installed. This ensures
  consistency across all systems
- Display a missing dependency error message when an unavailable command
  is used
- Require one of the four commands to be specified so that calling
  debsbom alone will display a usage error message
- Always import Compression from .util, regardless of whether the
  download dependencies are installed. This ensures that the parser is
  always set up with the correct compression options and results in
  consistent help messages

Closes siemens#75: debsbom without subcommand shows empty output

Signed-off-by: Tamino Larisch <tamino.larisch@siemens.com>
@tamilari tamilari force-pushed the fix/improveDependencyHandling branch from 8f7fcf6 to c22e498 Compare October 10, 2025 07:45
@Urist-McGit
Copy link
Collaborator

LGTM, what do you think @fmoessbauer?

@Urist-McGit Urist-McGit merged commit 52d0bf0 into siemens:main Oct 13, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants