Skip to content

Refactor, update to Pydantic v2 - #65

Merged
honnibal merged 22 commits into
mainfrom
refactor-pydantic
Apr 10, 2025
Merged

honnibal merged 22 commits into
mainfrom
refactor-pydantic

Conversation

@honnibal

Copy link
Copy Markdown
Member

Previously confection did three tree operations simultaneously (in the registry._fill method):

  • Build a version of the config with defaults in-place
  • Build a modified version suitable for validation
  • Build an output version with promises resolved

The fact that all three were being built at once made the code quite hard to update for Pydantic 2, and just difficult to work with in general. I've therefore refactored the code so that these are separate processes that apply to the whole tree at once.

A bonus of this is that we now build a model for the whole config and validate against that, which means all the validation errors for the config should come in at once, instead of only getting validation errors for one promise at a time.

Updating to Pydantic v2 will let spaCy finally support Python 3.13.

@honnibal
honnibal merged commit cfc185c into main Apr 10, 2025
This was referenced Nov 27, 2025
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