Repository navigation
Fix broken test_license_reference_to_file_beside_package_manifest test #4540 - #4811
Open
xovishnukosuri wants to merge 1 commit into
Open
xovishnukosuri wants to merge 1 commit into
xovishnukosuri wants to merge 1 commit into
Conversation
…importlib_metadata Remove non-existent file entries (beartype/meta.py and beartype/py.typed) from the test RECORD file and update the expected JSON accordingly. The RECORD file referenced files that don't exist in the test data directory. With importlib_metadata >= 8.0 (after python/importlib_metadata#437), Distribution.files only returns files that actually exist on disk, causing get_file_references() to return fewer entries than expected and breaking the test. Fixes aboutcode-org#4540 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
beartype/meta.pyandbeartype/py.typed) from the test RECORD file attests/packagedcode/data/license_detection/reference-to-license-beside-manifest/beartype-0.17.2/beartype-0.17.2.dist-info/RECORDfile_referencesentriesRoot Cause
The RECORD file in the beartype test data referenced
beartype/meta.pyandbeartype/py.typed, but onlybeartype/__init__.pyactually exists in the test data directory. Withimportlib_metadata>= 8.0 (after python/importlib_metadata#437 -- "Distribution.files: Only return files that actually exist"),get_file_references()insrc/packagedcode/pypi.pyreturns fewer file references than the expected JSON contains, causing the test assertion to fail.Fix
Rather than adding the missing files (which would bloat the test data with unnecessary files), this PR removes the two phantom entries from the RECORD file so it only lists files that are present. The expected JSON is updated accordingly.
This makes the test data self-consistent and compatible with both old and new versions of
importlib_metadata.Fixes #4540
Test plan
pytest -k test_license_reference_to_file_beside_package_manifest tests/packagedcode/test_license_detection.pyand confirm it passes with both pinned and newer importlib_metadata versions🤖 Generated with Claude Code