pip-licenses icon indicating copy to clipboard operation
pip-licenses copied to clipboard

Options --ignore-packages and --allow-only together not running as expected

Open jvitorinoj opened this issue 3 years ago • 1 comments

Consider the follow example:

export ALLOWED_PACKAGES="wrapt typing-extensions s3transfer"
export ALLOWED_LICENSES="MIT License;Apache Software License"

When I run: pip-licenses --allow-only=${ALLOWED_LICENSES} --ignore-packages="${ALLOWED_PACKAGES}

I get: license BSD License not in allow-only licenses was found for package wrapt

When I expected is the package wrapt (or any package in --ignore-packages option) to be completely ignored regardless of the license type.

jvitorinoj avatar Sep 30 '21 21:09 jvitorinoj

@jvitorinoj Thanks for the inquiry. This probably looks like a shell and argument problem.

For example, in the case of bash:

export ALLOWED_PACKAGES=("wrapt" "typing-extensions" "s3transfer")
export ALLOWED_LICENSES="MIT License;Apache Software License"

$ pip-licenses --allow-only=${ALLOWED_LICENSES} --ignore-packages "${ALLOWED_PACKAGES[@]}"
# Output license list ignoring wrapt/typing-extensions/s3transfer

Could you try this to see if it gives you the results you want?

raimon49 avatar Oct 02 '21 00:10 raimon49

This issue is deemed resolved.

raimon49 avatar Nov 06 '22 03:11 raimon49