raimon49 / pip-licenses

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

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

Closed jvitorinoj closed 1 year ago

jvitorinoj commented 2 years ago

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.

raimon49 commented 2 years ago

@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 commented 1 year ago

This issue is deemed resolved.