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

Support pydantic v2 #23

Merged
merged 2 commits into from
Apr 1, 2024
Merged

Support pydantic v2 #23

merged 2 commits into from
Apr 1, 2024

Conversation

tefra
Copy link
Owner

@tefra tefra commented Aug 30, 2023

📒 Description

The goal is to add support for pydantic v2 models.

  • Update filters to generate pydantic BaseModel subsclasses
  • Update Compat layer
  • Update fixtures
  • Pass all the sample suites

🔗 What I've Done

Write a description of the steps taken to resolve the issue

💬 Comments

A place to write any comments to the reviewer.

🛫 Checklist

  • Updated docs
  • Added unit-tests

@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Attention: Patch coverage is 93.65079% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 97.26%. Comparing base (729ac5e) to head (294939c).

Files Patch % Lines
xsdata_pydantic/compat.py 93.54% 2 Missing ⚠️
xsdata_pydantic/generator.py 90.90% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   95.57%   97.26%   +1.68%     
==========================================
  Files           6        7       +1     
  Lines         113      146      +33     
  Branches       11       15       +4     
==========================================
+ Hits          108      142      +34     
+ Misses          5        3       -2     
- Partials        0        1       +1     

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

@fleimgruber
Copy link

fleimgruber commented Feb 21, 2024

@tefra any plans on continuing this effort? Could you give me a rough idea of status and missing pieces then I can have a look and eventually have a shot at this.

@tefra
Copy link
Owner Author

tefra commented Feb 21, 2024

@tefra any plans on continuing this effort? Could you give me a rough idea of status and missing pieces then I can have a look and eventually have a shot at this.

I am so unbelievably stretched, honestly @fleimgruber I don't know, for the next couple of months I don't see how. Even then pydantic moves so fast this project is really doomed, I should admit defeat and simply shut it down.

@fleimgruber
Copy link

Thanks for checking back and your honesty. Maybe pydantic stabilizes at some point and then this can be picked up again - I think this project is a good idea!

@tefra
Copy link
Owner Author

tefra commented Mar 10, 2024

Pydantic has locked us out, there is no way to add additional metadata per field, the extras are deprecated and the json_schema_extra expects json values...

Creating true pydantic models, is impossible.... back to the drawing board

@tefra tefra force-pushed the new-gen branch 2 times, most recently from 455ca04 to 1778ea1 Compare March 31, 2024 14:03
@tefra tefra force-pushed the new-gen branch 8 times, most recently from e517d4d to 3bce9f6 Compare April 1, 2024 17:55
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