-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add option to pull license file path and contents #22
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
=========================================
- Coverage 97.59% 97.39% -0.2%
=========================================
Files 1 1
Lines 166 192 +26
=========================================
+ Hits 162 187 +25
- Misses 4 5 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
=========================================
- Coverage 97.59% 97.39% -0.2%
=========================================
Files 1 1
Lines 166 192 +26
=========================================
+ Hits 162 187 +25
- Misses 4 5 +1
Continue to review full report at Codecov.
|
Thank you for many suggestions and patches. I will take the time soon to review this. |
@@ -144,6 +145,11 @@ When executed with the `--with-description` option, output with short descriptio | |||
pytz 2017.3 MIT World timezone definitions, modern and historical | |||
``` | |||
|
|||
### Option: with-license-file | |||
|
|||
When executed with the `--with-license-file` option, output the location of the package's license file on disk and the full contents of that file. Due to the length of these fields, this option is best paired with `--format-json`. |
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.
The document is valid and I agree.
After merging this P-R, I make a warning to recommend the JSON format when running the --with-license-file
option with table format.
How do you like it?
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 agree that a warning to use the JSON format with --with-license-file
is a good idea.
PTable determines vertical layout based on row contents, even if those fields won't be output. Only add fields to rows that we intend to output. Update tests to ensure we are exercising FIELDS_TO_METADATA_KEYS
Agreed, this feature would be very useful, especially for non standard licenses. It would be great if it could do a compare of the licenses and print a summary of which packages use which licenses. |
@cpeel Thank you for rebase. I will merge this P-R and release next version of pip-licenses 1.11.0 to PyPI. And I will implement warning output at pip-licenses 1.12.0 and later. Your code is cool because it also supports Python 2.7 👍 |
My organization needs the ability to pull the license file path and contents, similar to how npm license-checker does when using
--customPath licenseText
. This adds that functionality with the--with-license-file
argument.While validating this, I discovered that PTable determines vertical table layout based on the data in the row even if those fields won't be output. Hence commit 90470ab to only add fields to the row if we want to output them. I've broken that into a separate logical commit but can break it out into another PR if that would be preferred.
During testing I also found a missing development dependency, hence the updates to
dev-requirements.in
(and the re-computeddev-requirements.txt
) in a separate commit.