raimon49 / pip-licenses

Dump the license list of packages installed with pip.
MIT License
314 stars 45 forks source link

Add --format=plain-vertical #61

Closed johnthagen closed 4 years ago

johnthagen commented 4 years ago

Closes #49

This matches the license style of Angular CLI (which calls license-webpack-plugin internally) and is more pleasing to view on horizontally-constrained environments (like some web pages) when license files are included.

codecov[bot] commented 4 years ago

Codecov Report

Merging #61 into master will increase coverage by 0.06%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
+ Coverage   98.35%   98.41%   +0.06%     
==========================================
  Files           1        1              
  Lines         304      316      +12     
==========================================
+ Hits          299      311      +12     
  Misses          5        5
Impacted Files Coverage Ξ”
piplicenses.py 98.41% <100%> (+0.06%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 742c814...4d7206d. Read the comment docs.

raimon49 commented 4 years ago

When run in my environment, the output is very simple.

PTable
0.9.2
BSD (3 clause)

The npm community has license-checker and licensify implementations. In my opinion I find it more useful to be like these implementations. What do you think?

For example, the following output would be useful:

PTable:
  version: 0.9.2
  license: BSD (3 clause)
johnthagen commented 4 years ago

@raimon49

The npm community has license-checker and licensify implementations. In my opinion I find it more useful to be like these implementations. What do you think?

I was trying to match the output style of Angular (see example here: https://angular.io/3rdpartylicenses.txt). Arguably, I'm using this with --with-license-file --no-license-path to match Angular closer.

I was also trying to keep the implementation as simple as possible, but I don't have a super strong opinion on how it actually looks, just that it's all vertically output rather than in columns (so it reads better on narrow windows).

What do you think? Since the license files themselves flow across multiple lines I wonder how that indented format would look. Would we need to indent every line of the license file?

raimon49 commented 4 years ago

@johnthagen All right. No problem with Angular-like styles.

In addition, I require that this new option be specified in the README.md document.

johnthagen commented 4 years ago

@raimon49 Great review, let me know what you think of the latest changes.

Please squash the commits if/when you merge. :)

raimon49 commented 4 years ago

@johnthagen Thanks for the good change πŸ‘

Please add it to the Table Of Contents in README.md.

Please squash the commits if/when you merge. :)

Sure.

johnthagen commented 4 years ago

Please add it to the Table Of Contents in README.md.

πŸ‘ Done.

raimon49 commented 4 years ago

Thank you to all of the work.

We will be able to use this format in the next release version of pip-licenses.

johnthagen commented 4 years ago

We will be able to use this format in the next release version of pip-licenses.

Awesome! Do you have any plans for when that might be?

raimon49 commented 4 years ago

I will be uploading to PyPI this week.So you can use it on 2020-02-01.