raimon49 / pip-licenses

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

package URL extraction improvements #162

Closed imrehg closed 1 year ago

imrehg commented 1 year ago

This PR has 2 parts:

  1. Switch to case-insensitive matching of fallback amongst the entries Project-URL. Came across many projects that do use lowercase for their entries, and previously they were listed with URL being UNKOWN.
  2. Add repository as another fallback. This I see popping up quite a bit among projects, instead of source.

Happy to hear feedback on either of these. 1. is a blocker for us on some projects, 2. is a potential nice-to-have but optional (added in a separate commit).

codecov[bot] commented 1 year ago

Codecov Report

Merging #162 (85ea3d1) into master (0849781) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #162   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files           1        1           
  Lines         433      433           
=======================================
  Hits          429      429           
  Misses          4        4           
Impacted Files Coverage Δ
piplicenses.py 99.07% <100.00%> (ø)
raimon49 commented 1 year ago

Thanks for the PR.

Happy to hear feedback on either of these. 1. is a blocker for us on some projects, 2. is a potential nice-to-have but optional (added in a separate commit).

Great, as far as the guideline about Declaring project metadata, it looks like there are projects that have set up repository keywords.

[project.urls]
homepage = "https://example.com"
documentation = "https://readthedocs.org"
repository = "https://github.com/me/spam.git"
changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"

Also, I see no problem with adding repository to the search target because homepage has priority as expressed in your test case.

raimon49 commented 1 year ago

@imrehg Uploaded as v4.3.2. https://pypi.org/project/pip-licenses/4.3.2/

Thank you for your contribution!