raimon49 / pip-licenses

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

feat: Use `author-email` metadata as fallback if `author` is None #153

Closed g3n35i5 closed 1 year ago

g3n35i5 commented 1 year ago

I noticed that some packages (e.g. termcolor) do not declare an author (metadata field author) but the email address of the author (metadata field author-email). For this reason I think it is appropriate to use this value as a fallback value.

Current output:

Name       Version  License      Author                                      
termcolor  2.2.0    MIT License  UNKNOWN

New output:

Name       Version  License      Author                                      
termcolor  2.2.0    MIT License  Konstantin Lepa <konstantin.lepa@gmail.com>

Other examples for packages with defined author-email but no author

g3n35i5 commented 1 year ago

Build failure on python 3.8 seems unrelated

[2023-03-30T10:13:45.738Z] ['error'] There was an error running the uploader: Error uploading to [https://codecov.io:](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
raimon49 commented 1 year ago

I too was concerned about the CI error, but it appears that it is now being reported in large numbers by the Codecov service.

@g3n35i5 There appears to be no problem with your fallback code. I will merge this patch and release the next version to PyPI.

Thanks!!

raimon49 commented 1 year ago

@g3n35i5 Thanks for your contribution.

The next release candidate version has been uploaded to PyPI. https://pypi.org/project/pip-licenses/4.2.0rc1/

Install it in your environment and make sure it is working as expected.

pip install pip-licenses==4.2.0rc1

If you have code to fix, please send a PR to the release-4.2.0 branch.

g3n35i5 commented 1 year ago

Install it in your environment and make sure it is working as expected.

Works as expected :)