Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pip): license support #6703

Closed
knqyf263 opened this issue May 16, 2024 · 0 comments · Fixed by #6782
Closed

feat(pip): license support #6703

knqyf263 opened this issue May 16, 2024 · 0 comments · Fixed by #6782
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. scan/license Issues relating to license scanning
Milestone

Comments

@knqyf263
Copy link
Collaborator

Description

Trivy currently doesn't support licenses for requirements.txt.

| pip ||| - |

We probably need to guess the path of site-packages and look into the directory for licenses. The python code is like this:

   for path in sys.path:
        if 'site-packages' in path:
            return path

    if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix):
        return os.path.join(sys.prefix, 'lib', 'python{}.{}'.format(*sys.version_info), 'site-packages')
@knqyf263 knqyf263 added kind/feature Categorizes issue or PR as related to a new feature. scan/license Issues relating to license scanning labels May 16, 2024
@knqyf263 knqyf263 added this to the v0.52.0 milestone May 16, 2024
@knqyf263 knqyf263 removed their assignment May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. scan/license Issues relating to license scanning
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants