fix(pylock): reject unknown keys in 1.0 lock data - #1352
Open
r266-tech wants to merge 2 commits into
Open
Conversation
sbidoul
reviewed
Jul 27, 2026
sbidoul
left a comment
Member
There was a problem hiding this comment.
The justification is about typos. But pylock files are meant to be generated by tools so that should not be an issue.
Ignoring unknown keys seems fine to me and I don't have much appetite to spend energy reviewing this.
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
pylock.toml1.0 document before parsing can discard themRationale
Pylock.from_dict()currently ignores keys it does not consume. A typo such asrequires-pythnormarkrtherefore produces a valid-looking lock object aftersilently removing an install-selection constraint.
The 1.0 schema closes the root, package, VCS, directory, archive, wheel, and
sdist objects. Dependency mappings, hashes, tool tables, and attestation
identity records remain open, so this change deliberately does not constrain
those extension-shaped mappings.
Testing
uv run pytest -q tests/test_pylock.py(72 passed)62403 passed, 1 skipped, 427 deselected;100%)git diff --check