Skip to content

Feat: option to use an alternative python environment #475

@jkowalleck

Description

@jkowalleck

Caused by #435 (comment)


Problem

Current implementation of the EnvironmentParser does analysis on the python environment of the runtime of this very tool.
There is no option to analyze a different python environment.

Example use case A:

It is a common use cases to globally install tools via pipenv, which creates a python environment dedicated to the tool. In such case, the cyclonedx-py -e would see the env of pipx, which might not be the desired one.

Solution

  • CLI
    • has a new option --env
      • accepts a path-like string
      • must occur only once
      • defaults to None
      • example values
        • ~/projects/foo/.venv/
        • ~/.local/share/virtualenvs/bar-SmGtsZ09
  • Implementation
    • CycloneDxCmd
      • whatever is needed. to be discussed
    • EnvironmentParser
      • whatever is needed. to be discussed
  • Docs (README.md and ./docs/**)
    • describe global installation via pipx
    • describe usage when installed via pipx
  • Tests
    • ship an independent/complete venv or something, and checks for correct detection of expected findings and no additional findings.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions