Skip to content

Conversation

ItsDrike
Copy link
Member

@ItsDrike ItsDrike commented Aug 8, 2025

Addresses: #6

This PR moves away from using simple dict objects in favor of custom typed pydantic V2 models. This provides us with validation that the individual instances each follow the expected structure (which was designed based on the JSON schemas), and allows users to rely on the auto-completion features of their editor to get the data they're interested in.

This also remaps all camelCase fields to snake_case to follow idiomatic python conventions.

Warning

This is a breaking change, since:

  • The load_common_data now returns a custom CommonData object, instead of a dict.
  • The load_version now returns a custom VersionData object, instead of a dict.

The custom objects are not backwards compatible with dict (No __getitem__ support, camelCase fields were converted to snake_case)

This PR also introduces 2 new runtime dependencies:

  • pydantic (for the model classes with automated conversion from a dict and field validations)
  • eval_type_backport (to allow using modern type annotations with pydantic fields)

@ItsDrike ItsDrike marked this pull request as draft August 8, 2025 20:43
@ItsDrike ItsDrike linked an issue Aug 8, 2025 that may be closed by this pull request
ItsDrike added a commit that referenced this pull request Aug 8, 2025
@ItsDrike ItsDrike added a: api Related to core public API of the project m: breaking This introduces backwards compatibility breaking changes to the public API t: feature New request or feature p: 1 - high Blocks other tasks / Important bug labels Aug 8, 2025
ItsDrike added a commit that referenced this pull request Aug 8, 2025
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch from c8bcc22 to 083198e Compare August 8, 2025 21:41
ItsDrike added a commit that referenced this pull request Aug 10, 2025
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch from 083198e to 8c73200 Compare August 10, 2025 15:40
ItsDrike added a commit that referenced this pull request Aug 10, 2025
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch 4 times, most recently from f289469 to d9c0205 Compare August 10, 2025 16:33
ItsDrike added a commit that referenced this pull request Aug 10, 2025
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch from d9c0205 to 3268792 Compare August 10, 2025 18:13
ItsDrike added a commit that referenced this pull request Aug 10, 2025
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch from 3268792 to 2c87df9 Compare August 10, 2025 18:17
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch from 2c87df9 to e043fcd Compare August 10, 2025 18:19
@ItsDrike ItsDrike added s: waiting for author Waiting for author to address a review or respond to a comment and removed s: waiting for author Waiting for author to address a review or respond to a comment labels Aug 10, 2025
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch 3 times, most recently from 0d3251b to 132947d Compare August 12, 2025 22:07
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch 12 times, most recently from 192b859 to 22797b0 Compare August 18, 2025 16:29
@ItsDrike ItsDrike force-pushed the use-pydantic-models branch from 22797b0 to 6cd586b Compare August 19, 2025 17:44
@py-mine-ci-bot py-mine-ci-bot bot added the s: stale Has had no activity for a while (might get closed for inactivity/marked up for grabs soon) label Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: api Related to core public API of the project m: breaking This introduces backwards compatibility breaking changes to the public API p: 1 - high Blocks other tasks / Important bug s: stale Has had no activity for a while (might get closed for inactivity/marked up for grabs soon) t: feature New request or feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type safety

1 participant