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

Update pydantic dependency to >= 2 #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dvzrv
Copy link

@dvzrv dvzrv commented Jul 23, 2023

I have used bump-pydantic on the code base to do the initial migration.
Afterwards I had to work on some details (e.g. __fields__ -> model_fields).

Please note, that I am very unsure about the changes to _get_pydantic_model_metadata(). Please review (or adapt as necessary)!

Fixes #72

@dvzrv dvzrv mentioned this pull request Jul 23, 2023
@codecov
Copy link

codecov bot commented Jul 23, 2023

Codecov Report

Merging #76 (5e10ea6) into master (6aca919) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 5e10ea6 differs from pull request most recent head 5a7f4e8. Consider uploading reports for the commit 5a7f4e8 to get more accurate results

@@            Coverage Diff            @@
##            master       #76   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          306       307    +1     
=========================================
+ Hits           306       307    +1     
Impacted Files Coverage Δ
itemadapter/adapter.py 100.00% <100.00%> (ø)
itemadapter/utils.py 100.00% <100.00%> (ø)

@elacuesta
Copy link
Member

Thanks for the contribution. Changes might be ok for pydantic>=2, but we need to keep supporting pydantic<2. I'd recommend something like this set of changes (currently failing except for the py-pydantic1 environment) to test against both versions.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Mar 20, 2024
https://build.opensuse.org/request/show/1159849
by user dgarcia + dimstar_suse
- Add pydantic2.patch to make tests compatible with pydantic2
  gh#scrapy/itemadapter#76
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.

Pydantic 2 released
2 participants