pip-licenses
pip-licenses copied to clipboard
Options --ignore-packages and --allow-only together not running as expected
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 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?
This issue is deemed resolved.