Install licensedcode-data with ScanCode release wheels#5056
Open
macayu17 wants to merge 1 commit into
Open
Conversation
Signed-off-by: macayu17 <anayush1406@gmail.com>
There was a problem hiding this comment.
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-datato the default dependency lists for the two release-wheelpyproject-*.tomlfiles. - Fix the
licensesoptional extra typo (licensecode-data→licensedcode-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 aslicensecode-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 on lines
+39
to
+40
| assert "licensedcode-data" in dependencies | ||
| assert "licensedcode-index" in dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5053
This PR adds
licensedcode-datato the default dependencies for thescancode-toolkitandscancode-toolkit-minirelease wheel metadata.The release wheels already depended on
licensedcode-index, but default installs did not pull in the license data package. That could leave built-in license loading without the data files needed at runtime.This also fixes the optional
licensesextra typo fromlicensecode-datatolicensedcode-data, and adds metadata tests so the release pyprojects keep the license data and index packages together.Testing
F:\Anaconda\python.exe -m pytest tests/scancode/test_release_metadata.py -qF:\Anaconda\python.exe -m py_compile tests/scancode/test_release_metadata.pygit diff --check upstream/develop...HEADTasks
Run tests locally to check for errors.