Skip to content

licensedcode: point at licensedcode-data when no builtin licenses load - #5341

Open
kumarasantosh wants to merge 1 commit into
aboutcode-org:developfrom
kumarasantosh:issue-5053-missing-licensedcode-data
Open

kumarasantosh wants to merge 1 commit into
aboutcode-org:developfrom
kumarasantosh:issue-5053-missing-licensedcode-data

Conversation

@kumarasantosh

Copy link
Copy Markdown
Contributor

Fixes #5053

Problem

licensedcode-data is an optional extra (scancode-toolkit[licenses]). When it is
not installed, load_licenses() raises a generic "No licenses were loaded" error
that doesn't say what is missing.

Change

  • When no licenses load from the builtin data dir, the InvalidLicense message
    now says the licensedcode-data package may be missing and how to install it
    (pip install licensedcode-data or pip install scancode-toolkit[licenses]).
  • Additional (user-supplied) license dirs keep the original message.
  • Added tests for both cases in tests/licensedcode/test_license_models.py.
  • Added a CHANGELOG entry.

When the builtin license data directory is empty, which happens when
scancode-toolkit is installed without the optional licensedcode-data
package, the InvalidLicense error now says that licensedcode-data may
be missing and how to install it.

Fixes aboutcode-org#5053

Signed-off-by: Santosh Pulikonda <santosh.pulikond02@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loading licenses should indicate licensedcode-data is not installed

1 participant