Repository navigation
refactor: migrate deprecated Pydantic v1 class Config to v2 ConfigDict - #660
Merged
chinmayajha merged 2 commits intoOct 28, 2026
Merged
Conversation
Migrate deprecated inner class Config: to Pydantic v2 model_config = ConfigDict(...) across the framework models to resolve deprecation warnings and prepare for Pydantic v3 compatibility. Closes mozarkai#311
Collaborator
|
@MilindChatrabhuji Thanks for this, are there any other Pydantic V1 references we could migrate? |
Contributor
Author
|
Hi @chinmayajha! I ran a full automated AST and regex audit across the entire repository to verify if any remaining Pydantic V1 patterns existed. Here is what was checked:
The entire codebase is now cleanly compliant with Pydantic V2 without any deprecated V1 compatibility shims or deprecation warnings. Everything is in place and ready to merge! |
chinmayajha
approved these changes
Oct 28, 2026
Collaborator
|
Thanks @MilindChatrabhuji ! |
|
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.



Description
Migrates deprecated Pydantic V1-style
class Config:inner classes to Pydantic V2model_config = ConfigDict(...)across the repository.Changes:
optics_framework/common/config_handler.py:DependencyConfig: Migratedclass Config(arbitrary_types_allowed = True) ->model_config = ConfigDict(arbitrary_types_allowed=True).Config: Migratedclass Config(arbitrary_types_allowed = True) ->model_config = ConfigDict(arbitrary_types_allowed=True).ConfigDictimport frompydantic.optics_framework/common/base_factory.py:GenericFactory.ModuleRegistry: Migratedclass Config(arbitrary_types_allowed = True) ->model_config = ConfigDict(arbitrary_types_allowed=True).InstanceFallback: Migratedclass Config(arbitrary_types_allowed = True) ->model_config = ConfigDict(arbitrary_types_allowed=True).ConfigDictimport frompydantic.optics_framework/engines/drivers/ble.py:CapabilitiesConfig: Migratedclass Config(populate_by_name = True) ->model_config = ConfigDict(populate_by_name=True).ConfigDictimport frompydantic.optics_framework/engines/elementsources/camera_screenshot.py:CapabilitiesConfig: Migratedclass Config(populate_by_name = True) ->model_config = ConfigDict(populate_by_name=True).ConfigDictimport frompydantic.Verification:
class Config:across the codebase (git grep -n "class Config:").-W error::pydantic.warnings.PydanticDeprecatedSince20, confirming 0 deprecation warnings and all tests passing.Closes #311