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

Migrate to pydantic 2 #60

Merged
merged 5 commits into from
Nov 5, 2024
Merged

Migrate to pydantic 2 #60

merged 5 commits into from
Nov 5, 2024

Conversation

upils
Copy link
Collaborator

@upils upils commented Sep 24, 2024

Migrate to pydantic V2 and adapt to new craft libraries.

Fixes: FR-8917

@upils upils self-assigned this Sep 24, 2024
Base automatically changed from rename-ubuntu-seed-plugin to main October 3, 2024 06:42
@upils upils force-pushed the migrate-to-pydantic-2 branch from a978195 to ce018d4 Compare October 4, 2024 14:14
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.06%. Comparing base (0d59203) to head (6d47eb2).
Report is 60 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   97.51%   98.06%   +0.55%     
==========================================
  Files          20       20              
  Lines         482      414      -68     
  Branches       74       60      -14     
==========================================
- Hits          470      406      -64     
+ Misses          9        7       -2     
+ Partials        3        1       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@upils upils force-pushed the migrate-to-pydantic-2 branch 4 times, most recently from 12e2666 to 85641a5 Compare October 14, 2024 15:09
@upils upils marked this pull request as ready for review October 15, 2024 08:54
@upils upils requested a review from sil2100 October 15, 2024 08:55
@upils
Copy link
Collaborator Author

upils commented Oct 15, 2024

@cmatsuoka @tigarmo A quick review of this from the craft team would be greatly appreciated if you can spare some time!

Copy link

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

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

nice :)

upils added 5 commits November 5, 2024 09:32
- remove duplicated validation
- Use new ConfigDict
- replace validators with field_validator and model_validator
- adapt to new errors
- adapt to new craft_parts Plugin
- use model_dump
- rely on model_validate to unmarshal objects

Signed-off-by: Paul Mars <[email protected]>
Apply the same fix as in canonical/craft-parts#795

Signed-off-by: Paul Mars <[email protected]>
@upils upils force-pushed the migrate-to-pydantic-2 branch from f5e5c7b to 6d47eb2 Compare November 5, 2024 08:33
@upils upils merged commit be1741a into main Nov 5, 2024
12 of 14 checks passed
@upils upils deleted the migrate-to-pydantic-2 branch November 5, 2024 09:18
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.

2 participants