pip-check-reqs
pip-check-reqs copied to clipboard
add whitelist support
As I started using this great package, I noticed a big thing that's missing: the ability to add a whitelist for the pip-extra-reqs
command. My use case is as follows:
- my api is built using
flask
- when a
docker
container with my api gets built, it gets served usinggunicorn
- the
gunicorn
package gets used only when running the docker entrypoint, and noimport gunicorn
is found in the code - if I use the
pip-extra-reqs
command during my builds, theu fail becausegunicorn
is seen as an unused package. - having something like
pip-extra-reqs --whitelist-packages=gunicorn ...
would remove this issue which I believe could affect a number of users. For example in my case I am unable to use this functionality at all as the build would fail each time
I don't believe this issue affects the pip-missing-reqs
command
After some testing I can also suggest the addition of a whitelist for the pip-missing-reqs
command, as for example the keras
ml library requires a backend, which doesn't need to be actually used in the code. This results in an extra dependency result which should be ignored
@HitLuca Just to be sure - have you looked at / considered the --ignore-requirement
option in pip-extra-reqs
?
Looks like I completely overlooked that, because that section in the Readme talks about ignoring modules and I interpreted that as project subfolders, not actual libraries. Thank you.
@HitLuca I would welcome a README PR.
Sure, I'll make one when I have the time
In any case, I am still thinking that a whitelist could be a useful addition