Skip to content

kw_only on frozen mock types; freeze key validator routes#3077

Merged
adamtheturtle merged 1 commit intomainfrom
dataclass-frozen-kw-only-mock
Mar 29, 2026
Merged

kw_only on frozen mock types; freeze key validator routes#3077
adamtheturtle merged 1 commit intomainfrom
dataclass-frozen-kw-only-mock

Conversation

@adamtheturtle
Copy link
Copy Markdown
Member

@adamtheturtle adamtheturtle commented Mar 29, 2026

Summary

  • CloudDatabase, VuMarkDatabase, ImageTarget, VuMarkTarget: add kw_only=True.
  • RequestData, Route (_mock_common): add kw_only=True.
  • key_validators._Route: frozen=True, kw_only=True.
  • Test helpers 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=True to RequestData, Route, CloudDatabase, VuMarkDatabase, ImageTarget, VuMarkTarget, and key test helpers (e.g. Endpoint, VuMarkCloudDatabase).

Tightens immutability/consistency in key validation by making key_validators._Route a frozen=True keyword-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.

- 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
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.

1 participant