Skip to content

Feat: option to use an alternative python environment #475

Closed

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.

Activity

  1. added
    enhancement
    help wanted
    on Dec 22, 2022
  2. Kwintenvdb commented on Apr 6, 2023

    @Kwintenvdb

    Hi - was wondering if this feature is anywhere on the roadmap. We are trying to use this tool to generate an SBOM for our Python environment (since using the environment-based approach is the only way to include license information in the SBOM), and this issue is a bit of a blocker for us, since we do not want to include this tool and its dependencies in the SBOM we publish.

  3. jkowalleck commented on Apr 6, 2023

    @jkowalleck
    MemberAuthor

    It is labeled "help wanted" - meaning: it is not a core feature on the current roadmap, and we are open for pull requests and discussions.
    Feel free to contribute this feature, if this is a blocker for you. ;-)

  4. jkowalleck commented on Dec 17, 2023

    @jkowalleck
    MemberAuthor

    shall be implemented via #627

  5. self-assigned this
    on Dec 17, 2023
  6. linked a pull request that will close this issuefeat!: rewrite CLI and parsers #610on Dec 22, 2023
  7. removed
    help wanted
    on Dec 22, 2023
  8. jkowalleck commented on Dec 25, 2023

    @jkowalleck
    MemberAuthor

    fixed by #605

  9. jkowalleck commented on Dec 25, 2023

    @jkowalleck
    MemberAuthor

    This feature will be part of the next/upcoming major release.
    Changelog: see #605
    Install via: pip install cyclonedx-bom==4.0.0rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementsource: environment

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions