raimon49 / pip-licenses

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

Question: Why is pip-licenses considered to be part of system packages? #117

Closed fredrikbondesson closed 2 years ago

fredrikbondesson commented 2 years ago

I have noticed that pip-licenses (as well as PTable) is considered to be part of the system packages, at least the --with-system argument is needed to show corresponding license information.

I am not sure I understand the reason for this? For me it is a tool that I have added to my requirements file as many other tools. Then when I am trying to gather license information, I definitely would like it to show up in the normal(non system) list.

Thanks for providing a very useful tool Regards Fredrik

raimon49 commented 2 years ago

@fredrikbondesson Thanks, this is a good question.

pip-licenses was originally a small Python script I wrote for my own workflow. So when I made this script installable as a Python package, I did not want to show pip-licenses (and PTable, which is automatically installed with dependencies).

However, as you say, it might be better to remove pip-licenses as part of the system package. I will remind myself of this issue when I do a major version in the future.

johnthagen commented 2 years ago

I personally think the way this works currently is more accurate. I use pip-licenses to make a license report of my actual requirements (not dev-requirements, etc.) The only way for pip-licenses to do this is to be installed into the same environment. I'm not distributing or actually depending on pip-licenses at runtime (and I doubt many apps would?), it's simply a tool to generate the license report.

This is very similar to the other system packages, like pip. My application at runtime doesn't depend on it, but it has to be in the environment so that the other dependencies can be reported (by installing pip-licenses.

Perhaps there should be a way to opt-in to including pip-licenses and PTable? But I personally think the current behavior should remain the default.

raimon49 commented 2 years ago

@johnthagen @fredrikbondesson I do not intend to change the behavior as system packages for now.

However, it is good that this behavior is clearly documented. I've just added it to the README document.

Thanks for the good discussion!