feat: Use license-expression as fallback for license (PEP-639)#229
Closed
g3n35i5 wants to merge 1 commit into
Closed
feat: Use license-expression as fallback for license (PEP-639)#229g3n35i5 wants to merge 1 commit into
license-expression as fallback for license (PEP-639)#229g3n35i5 wants to merge 1 commit into
Conversation
[PEP-639](https://peps.python.org/pep-0639/) allows declaring the license in the `License-Expression` metadata field. Using this as fallback fixes resolving the licenses of some packages, e.g. `termcolor==3.0.1`, `prettytable==3.16.0` and `typing_extensions==4.13.1` **Verifying the change** ```bash pip-licenses -p prettytable typing-extensions termcolor -a -s -u -d -f json ``` Before ```json [ { "Author": "Luke Maurits <luke@maurits.id.au>", "Description": "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format", "License": "UNKNOWN", "Name": "prettytable", "URL": "https://github.com/prettytable/prettytable", "Version": "3.16.0" }, { "Author": "Konstantin Lepa <konstantin.lepa@gmail.com>", "Description": "ANSI color formatting for output in terminal", "License": "UNKNOWN", "Name": "termcolor", "URL": "https://github.com/termcolor/termcolor", "Version": "3.0.1" }, { "Author": "\"Guido van Rossum, Jukka Lehtosalo, \u0141ukasz Langa, Michael Lee\" <levkivskyi@gmail.com>", "Description": "Backported and Experimental Type Hints for Python 3.8+", "License": "UNKNOWN", "Name": "typing_extensions", "URL": "https://github.com/python/typing_extensions", "Version": "4.13.1" } ] ``` **After** ```json [ { "Author": "Luke Maurits <luke@maurits.id.au>", "Description": "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format", "License": "BSD-3-Clause", "Name": "prettytable", "URL": "https://github.com/prettytable/prettytable", "Version": "3.16.0" }, { "Author": "Konstantin Lepa <konstantin.lepa@gmail.com>", "Description": "ANSI color formatting for output in terminal", "License": "MIT", "Name": "termcolor", "URL": "https://github.com/termcolor/termcolor", "Version": "3.0.1" }, { "Author": "\"Guido van Rossum, Jukka Lehtosalo, \u0141ukasz Langa, Michael Lee\" <levkivskyi@gmail.com>", "Description": "Backported and Experimental Type Hints for Python 3.8+", "License": "PSF-2.0", "Name": "typing_extensions", "URL": "https://github.com/python/typing_extensions", "Version": "4.13.1" } ] ```
g3n35i5
marked this pull request as ready for review
April 4, 2025 18:15
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #229 +/- ##
=======================================
Coverage 99.13% 99.13%
=======================================
Files 1 1
Lines 462 462
=======================================
Hits 458 458
Misses 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Duplicate of #213. |
Contributor
Author
|
Oops my bad |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PEP-639 allows declaring the license in the
License-Expressionmetadata field. Using this as fallback fixes resolving the licenses of some packages, e.g.termcolor==3.0.1,prettytable==3.16.0andtyping_extensions==4.13.1Verifying the change
Before
[ { "Author": "Luke Maurits <luke@maurits.id.au>", "Description": "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format", "License": "UNKNOWN", "Name": "prettytable", "URL": "https://github.com/prettytable/prettytable", "Version": "3.16.0" }, { "Author": "Konstantin Lepa <konstantin.lepa@gmail.com>", "Description": "ANSI color formatting for output in terminal", "License": "UNKNOWN", "Name": "termcolor", "URL": "https://github.com/termcolor/termcolor", "Version": "3.0.1" }, { "Author": "\"Guido van Rossum, Jukka Lehtosalo, \u0141ukasz Langa, Michael Lee\" <levkivskyi@gmail.com>", "Description": "Backported and Experimental Type Hints for Python 3.8+", "License": "UNKNOWN", "Name": "typing_extensions", "URL": "https://github.com/python/typing_extensions", "Version": "4.13.1" } ]After
[ { "Author": "Luke Maurits <luke@maurits.id.au>", "Description": "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format", "License": "BSD-3-Clause", "Name": "prettytable", "URL": "https://github.com/prettytable/prettytable", "Version": "3.16.0" }, { "Author": "Konstantin Lepa <konstantin.lepa@gmail.com>", "Description": "ANSI color formatting for output in terminal", "License": "MIT", "Name": "termcolor", "URL": "https://github.com/termcolor/termcolor", "Version": "3.0.1" }, { "Author": "\"Guido van Rossum, Jukka Lehtosalo, \u0141ukasz Langa, Michael Lee\" <levkivskyi@gmail.com>", "Description": "Backported and Experimental Type Hints for Python 3.8+", "License": "PSF-2.0", "Name": "typing_extensions", "URL": "https://github.com/python/typing_extensions", "Version": "4.13.1" } ]This resolves #225
This relates to #89