Skip to content
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

Make cos_agent charm library compatible with Pydantic v1/v2 #156

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

weiiwang01
Copy link
Contributor

Issue

Partially fixes #114, where the cos_agent charm library is not compatible with charms or other charm libraries that use Pydantic v2.

Solution

Pydantic v2 provides full v1 compatibility via the pydantic.v1 namespace. When it is detected that the environment is using Pydantic v2, switch to using that instead of importing Pydantic v2.

Upgrade Notes

This should have no impact on any existing charms.

Copy link
Contributor

@Abuelodelanada Abuelodelanada left a comment

Choose a reason for hiding this comment

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

Good job @weiiwang01 !!

@Abuelodelanada Abuelodelanada merged commit df353b1 into canonical:main Aug 8, 2024
12 checks passed
@weiiwang01 weiiwang01 deleted the cos-agent-pydantic branch August 8, 2024 18:43
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.

bump to pydantic v2
2 participants