Skip to content

Failure to detect dependency relationships between Python packages #3958

@christoph-blessing

Description

@christoph-blessing

What happened: Syft fails to detect that click==8.2.1 is a dependency of flask==3.1.1 when scanning a virtual environment that has both packages installed.

What you expected to happen: Syft detects the dependency relationship.

Steps to reproduce the issue:

  1. Create and activate virtual environment
  2. Install flask
  3. Scan directory containing virtual environment
  4. Check whether SBOM contains dependency relationship between flask and click

Anything else we need to know?: I think this is caused by incorrect parsing of the Requires-Dist field in the wheel's METADATA file. The relevant code expects parentheses around the version specifier when in fact parsers should treat them as being optional.

Environment:

  • Output of syft version: 1.24.0
  • OS (e.g: cat /etc/os-release or similar): NixOS 25.11 (Xantusia)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingecosystem:pythonrelated to the python ecosystemgood-first-issueGood for newcomers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions