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(python): parse licenses from dist-info folder #4724

Merged
merged 20 commits into from
Jan 4, 2024

Conversation

nikpivkin
Copy link
Contributor

@nikpivkin nikpivkin commented Jun 28, 2023

Description

PEP-639 proposes adding the License-File field, which contains the path relative to the root of the project to the license-related file (but setuptools records the full relative path to the license). This PR adds support for new license-related fields. If a specific license is not specified in the metadata, then we can classify the license from the file that is specified in the License-File field.

Currently, the Wheel and (following its example) Setuptools projects flatten all license files into the .dist-info directory without preserving the source subdirectory hierarchy.

PEP-639 proposes several options for the location of files.

Related issues

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@nikpivkin nikpivkin marked this pull request as ready for review July 14, 2023 08:00
@nikpivkin nikpivkin requested a review from knqyf263 as a code owner July 14, 2023 08:00
@nikpivkin nikpivkin changed the title feat(python): parse licenses from packages feat(python): parse licenses from dist-info folder Jul 14, 2023
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

@nikpivkin
Left some comments.
Take a look, please

Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

left comments

pkg/fanal/analyzer/language/python/packaging/packaging.go Outdated Show resolved Hide resolved
pkg/fanal/analyzer/language/python/packaging/packaging.go Outdated Show resolved Hide resolved
pkg/fanal/analyzer/language/python/packaging/packaging.go Outdated Show resolved Hide resolved
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

lgtm

@liorj-orca
Copy link
Contributor

looking forward to it! @knqyf263 @DmitriyLewen any update with this one?

Copy link

github-actions bot commented Dec 1, 2023

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Dec 1, 2023
@DmitriyLewen DmitriyLewen removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Dec 1, 2023
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 added this pull request to the merge queue Jan 4, 2024
Merged via the queue into aquasecurity:main with commit df3e90a Jan 4, 2024
12 checks passed
@nikpivkin nikpivkin deleted the feat/python-post branch January 9, 2024 07:09
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.

feat(python): parse licenses from dist-info folder
4 participants