Skip to content

Support defining Schemas as dicts#939

Merged
ahal merged 3 commits intotaskcluster:mainfrom
ahal:ahal/push-kmvltlksysly
Apr 24, 2026
Merged

Support defining Schemas as dicts#939
ahal merged 3 commits intotaskcluster:mainfrom
ahal:ahal/push-kmvltlksysly

Conversation

@ahal
Copy link
Copy Markdown
Collaborator

@ahal ahal commented Apr 23, 2026

Msgspec schemas are much faster, but I find the struct based definitions to look clunky, especially with many nested structs. This uses msgspec.defstruct to support defining schemas as a dictionary, somewhat similar to how the voluptuous schemas used to look.

I converted one file (from_deps.py) as an example of what the new format looks like. Will update the rest in a follow-up PR.

@ahal ahal self-assigned this Apr 23, 2026
@ahal ahal requested a review from a team as a code owner April 23, 2026 19:20
@ahal ahal requested a review from hneiva April 23, 2026 19:20
ahal added 2 commits April 23, 2026 15:50
This provides an alternative way to define schemas, which IMO looks a
bit nicer than the class based approach. One big benefit of this method
is that you can use dashes in the keys, so it's possible to use both
underscores and dashes as identifiers and it's clear to the user which
is which.
@ahal ahal force-pushed the ahal/push-kmvltlksysly branch from dbb6873 to f954448 Compare April 23, 2026 19:50
@ahal ahal force-pushed the ahal/push-kmvltlksysly branch from f954448 to 16e4273 Compare April 23, 2026 19:51
Copy link
Copy Markdown
Contributor

@hneiva hneiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super familiar with how MsgSpec Schemas work, but LGTM

@ahal ahal merged commit c2bd792 into taskcluster:main Apr 24, 2026
22 checks passed
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.

2 participants