-
Notifications
You must be signed in to change notification settings - Fork 106
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(license): add struct with types for licenses #256
base: main
Are you sure you want to change the base?
feat(license): add struct with types for licenses #256
Conversation
pkg/types/types.go
Outdated
@@ -74,4 +74,6 @@ const ( | |||
RefVCS RefType = "vcs" | |||
RefIssueTracker RefType = "issue-tracker" | |||
RefOther RefType = "other" | |||
|
|||
NonSeparableLicensePrefix = "non-separable: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have file:// prefix.
Perhaps we want to create new struct for License field.
just as idea:
type License struct {
Value string
Type licenseType
}
type licenseType string
const (
fileLicenseType licenseType = "file" // filename for license file
textLicenseType licenseType = "text" // text of license (for split, classifier, etc.)
nonSeparableTextLicenseType licenseType = "nonSeparable-text" // text of license without possible to split
formattedLicenseType licenseType = "formattedLicenses" // formatted licenses (e.g. in SPDX format)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds reasonable. We can go with that approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knqyf263 I have added licenseType
to this PR.
I also updated aquasecurity/trivy#5211 to show the required changes for Trivy.
#5211 requires some refactoring. I will do this if you confirm that we are ready for these changes.
// https://packaging.python.org/en/latest/specifications/core-metadata/#license, | ||
// but it is impossible to define a delimiter to separate them. | ||
// Mark them, so we don't have to separate them later. | ||
license = types.NonSeparableLicensePrefix + l | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about checking license classifiers
before license
, but in this case we might miss some nuances (like license exclusion).
So I left the old order.
@DmitriyLewen is this going to be picked up again soon? :) |
Hello @lior-orca @knqyf263 Can you take a look at these changes? |
Please give me some more time. I have some prioritized tasks. |
@knqyf263 any updated? :) |
…/dont-split-python-licenes
@DmitriyLewen any updates on this one? |
Hello @lior-orca |
non-separable
prefix for python packaging
Description
To exclude prefixes for licenses, add a new License structure with types:
This structure will be needed for subsequent analysis of these licenses (if necessary).