Skip to content

Fix licensedcode-data optional extra#5056

Merged
AyanSinhaMahapatra merged 1 commit into
aboutcode-org:developfrom
macayu17:fix/5053-license-data-message
May 25, 2026
Merged

Fix licensedcode-data optional extra#5056
AyanSinhaMahapatra merged 1 commit into
aboutcode-org:developfrom
macayu17:fix/5053-license-data-message

Conversation

@macayu17
Copy link
Copy Markdown
Contributor

@macayu17 macayu17 commented May 23, 2026

Reference:

This PR fixes the optional licenses extra dependency typo from licensecode-data to licensedcode-data in the ScanCode pyproject files.

Testing

  • venv\Scripts\python.exe -m pip check
  • metadata validation script for the licenses extra and release-wheel default dependencies
  • git diff --check upstream/develop

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled and links the original issue above
  • Commits are in uniquely-named feature branch and has no merge conflicts
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Copilot AI review requested due to automatic review settings May 23, 2026 17:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures licensedcode-data is installed by default with the scancode-toolkit and scancode-toolkit-mini release wheels, preventing runtime failures when built-in license loading expects bundled license data files.

Changes:

  • Add licensedcode-data to the default dependency lists for the two release-wheel pyproject-*.toml files.
  • Fix the licenses optional extra typo (licensecode-datalicensedcode-data) across pyprojects.
  • Add a metadata-focused test to keep release wheel dependencies consistent, and document the fix in the changelog.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/scancode/test_release_metadata.py Adds tests to assert release-wheel metadata includes both license index and license data packages, and that the licenses extra uses the correct package name.
pyproject.toml Fixes the licenses optional extra to reference licensedcode-data (and not the typo).
pyproject-scancode-toolkit.toml Adds licensedcode-data to default dependencies for the release wheel and fixes the licenses extra typo.
pyproject-scancode-toolkit-mini.toml Adds licensedcode-data to default dependencies for the mini release wheel and fixes the licenses extra typo.
CHANGELOG.rst Notes the dependency fix for default installs in the “Next release” section.
AUTHORS.rst Adds a new contributor entry.
Comments suppressed due to low confidence (1)

tests/scancode/test_release_metadata.py:50

  • These checks are also exact-string matches. If the optional dependency is ever expressed with a version/marker (e.g. licensedcode-data>=… or the typo appears as licensecode-data>=…), the assertions may give false negatives. Consider matching by parsed requirement name or using a prefix/name-based check.
        assert "licensedcode-data" in license_dependencies
        assert "licensecode-data" not in license_dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/scancode/test_release_metadata.py Outdated
Copy link
Copy Markdown
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macayu17 thanks!
See comments for your consideration.

Not exactly the intended solution, so removed the fixes keyword from the PR description.

[project.optional-dependencies]
licenses = [
"licensecode-data",
"licensedcode-data",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, can you add a PR with just these changes?

Comment thread pyproject-scancode-toolkit-mini.toml Outdated
]

dependencies = [
"licensedcode-data",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not what we intend, the licensedcode-data should only be installed optionally/if intended.

Comment thread tests/scancode/test_release_metadata.py Outdated
assert "licensedcode-index" in dependencies


def test_scancode_license_extra_uses_licensedcode_data_package():
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something we want to test like this at all. PLease remove thew whole file

Signed-off-by: macayu17 <anayush1406@gmail.com>
@macayu17 macayu17 force-pushed the fix/5053-license-data-message branch from 02f0c38 to 5ffaeac Compare May 25, 2026 13:10
@macayu17 macayu17 changed the title Install licensedcode-data with ScanCode release wheels Fix licensedcode-data optional extra May 25, 2026
Copy link
Copy Markdown
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @macayu17

@AyanSinhaMahapatra AyanSinhaMahapatra merged commit 5d688a0 into aboutcode-org:develop May 25, 2026
36 checks passed
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.

3 participants