-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⬆️ 0.8/pydantic2 fix #1378
⬆️ 0.8/pydantic2 fix #1378
Conversation
@@ -38,6 +38,34 @@ | |||
META_VALIDATOR = "__glotaran_validator__" | |||
|
|||
|
|||
class GlotaranFieldMetadata(UserDict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this whole thing isn't really pretty but we need to it keeps us going for now until we reevaluate the need for an extra evaluation mechanism.
e0fe6b4
to
ebe23ac
Compare
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
We still need to deal with
But those are for a different discussion and PR 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look sound to me
and update requirements_dev.txt so as to not get into CI trouble
for more information, see https://pre-commit.ci
Without the type annotation it is omitted from the fields
ebe23ac
to
0d03073
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Various fixes related to the pydantic1 to pydantic2 upgrade. Some details: * Autoconvert to pydantic 2. * Replace missing clasing with any. * Adapted typing for pydantic 2. * Check if Factory is needed and update requirements_dev.txt so as to not get into CI trouble * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * 🩹 Fix assignment of literal type to type attribute * 🩹 Use RootModel instead of BaseModel and __root__ * 🩹 Replace deprecated parse_obj with model_validate * 🩹 Fix accessing of element data_model_type * 🩹 Undefined -> PydanticUndefined * 🩹 Adjust to removal of ModelField https://docs.pydantic.dev/latest/migration/#changes-to-validators-allowed-signatures * 🧪🩹 Adapt to schema changes * 🧪🩹 Fix pydantic validation error in test * 🧪🩹 Fix definition MockElementWithDataModel.data_model_type Without the type annotation it is omitted from the fields * 🧹 Replace .dict with .model_dump * 🧹 Replace .copy with .model_copy * 🤖 Refactored by Sourcery --------- Co-authored-by: Joern Weissenborn <joern.weissenborn@gmail.com> Co-authored-by: Joris Snellenburg <jsnel@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sourcery AI <>
This is based on #1368 but I made a separate PR so @joernweissenborn can review my changes.
Upgrading to pydantic 2 is the first step we need to take before we can make schema generation work.