raimon49 / pip-licenses

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

Add support to "alternate license files" (e.g. LICENSE.BSD, LICENSE.APACHE) --with-license-file #194

Open joao-dgg opened 3 months ago

joao-dgg commented 3 months ago

The packaging module has multiple licenses, Apache and BSD. When using the --with-license-file with the module in question, the result is as follow:

packaging 24.0 Apache Software License; BSD License This software is made available under the terms of either of the licenses found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made under the terms of both these licenses.

Checking the .whl of said package, there are three license files in total: LICENSE (which is the text quoted above), LICENSE.BSD and LICENSE.APACHE.

I assume pip-licenses currently does not support said 'alternate' or additional files? Or is there a flag I might have missed?

Apologies on ahead if the title is unclear, but I wasn't sure how else to name it.

joao-dgg commented 3 months ago

Checking the changelog, I see that a specific file is chosen, or at least this used to be the case. Would there be any way to go with "all" LICENSE* files? image

stefan6419846 commented 3 months ago

This has been proposed in #78 already, but closed for now. The reason is that https://github.com/raimon49/pip-licenses/blob/6176cc5e0849cefc77092cb1e530852503d31c17/piplicenses.py#L209-L218 breaks on the first file.