-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(license): reorder logic of how python package licenses are acquired #6220
Conversation
ee3cc93
to
d990009
Compare
d990009
to
d82a816
Compare
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.
Hello @dus7eh
Thanks for your work!
I did some refactoring. Look here please. If you agree with this, please update the tests.
Also i left some comments.
@@ -20,8 +20,6 @@ func NewParser() types.Parser { | |||
return &Parser{} | |||
} | |||
|
|||
// Parse parses egg and wheel metadata. | |||
// e.g. .egg-info/PKG-INFO and dist-info/METADATA |
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.
Did you have reason to remove this comment?
{Name: "pyphen", Version: "0.14.0", License: "GNU General Public License v2 or later (GPLv2+)"}, | ||
{Name: "pyphen", Version: "0.14.0", License: "GNU Lesser General Public License v2 or later (LGPLv2+)"}, | ||
{Name: "pyphen", Version: "0.14.0", License: "Mozilla Public License 1.1 (MPL 1.1)"}, |
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.
Your solution creates duplicate packages. It is not right.
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 think you can reduce the length of file by removing lines that are unnecessary for tests.
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.
same
I've fixed most but now the licenses get incorretly split. However we might treat this as a different bug. Context:
|
I assumed that such a situation was possible 😞 |
I believe that before doing
In the future, when the new structure is in place similar verification could be done for different languages at lower level. For example for python against trove license classifiers (https://pypi.org/classifiers/). Then such license could be flagged as "NonSplittable" type. |
This is good way. But i see one problem with p1: |
Well, so the solution here would be to join licenses on a different char or set of characters |
a848a9f
to
3d9076d
Compare
Do you want to move new logic for license normalization to another PR? |
No, I'm fine with that in this PR. |
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.
Description
Change precedence of fields when reading python package licenses
Kept "License-expression" with highest importance although pep describing it is in draft state.
Then, trove license classifiers are read and if not present "License" field is taken into account. Lastly without changes "License-File".
Related issues
License
field from python packaging #5204 issueChecklist