kw_only on frozen mock types; freeze key validator routes#3077
Merged
adamtheturtle merged 1 commit intomainfrom Mar 29, 2026
Merged
kw_only on frozen mock types; freeze key validator routes#3077adamtheturtle merged 1 commit intomainfrom
adamtheturtle merged 1 commit intomainfrom
Conversation
- CloudDatabase, VuMarkDatabase, ImageTarget, VuMarkTarget: kw_only=True alongside existing frozen equality semantics. - RequestData, Route: kw_only=True for clearer HTTP/route construction. - key_validators._Route: frozen and kw_only as static endpoint metadata. - Test fixtures Endpoint, VuMarkCloudDatabase, InactiveVuMarkCloudDatabase: kw_only=True for multi-field credentials helpers. Made-with: Cursor
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
CloudDatabase,VuMarkDatabase,ImageTarget,VuMarkTarget: addkw_only=True.RequestData,Route(_mock_common): addkw_only=True.key_validators._Route:frozen=True,kw_only=True.Endpoint,VuMarkCloudDatabase,InactiveVuMarkCloudDatabase:kw_only=True.Existing call sites use keyword arguments.
Testing
uv run pytest tests/mock_vws/test_target_validators.py— passed. Full suite hits Docker/real-Vuforia parametrization in this environment.Made with Cursor
Note
Medium Risk
This is a potentially breaking API change: several public/semipublic dataclasses now require keyword-only construction, which will fail at runtime for any downstream positional call sites. Behavior is otherwise unchanged and existing in-repo call sites already use keywords.
Overview
Makes multiple mock model/helper dataclasses keyword-only by adding
kw_only=TruetoRequestData,Route,CloudDatabase,VuMarkDatabase,ImageTarget,VuMarkTarget, and key test helpers (e.g.Endpoint,VuMarkCloudDatabase).Tightens immutability/consistency in key validation by making
key_validators._Routeafrozen=Truekeyword-only dataclass, preventing accidental mutation of route definitions during validation.Written by Cursor Bugbot for commit 7b6817e. This will update automatically on new commits. Configure here.