-
Notifications
You must be signed in to change notification settings - Fork 13
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
Pydantic v2 support #91
Conversation
Tests are expected to fail with pydantic>=2
self.assertFalse(PydanticAdapter.is_item(ScrapyItem())) | ||
self.assertFalse(PydanticAdapter.is_item(ScrapySubclassedItem())) | ||
|
||
@unittest.skipIf(not PydanticV1Model, "pydantic <2 module is not available") |
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.
would it make sense to skip the whole test module if pydantic1 is not available?
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.
For the record, pydantic1 is always available if pydantic (whatever version) is installed.
It may make sense not to run extra-specific tests if the corresponding extra is not installed. But only if the corresponding adapter is not available in that scenario. It currently is available and I think it makes sense to test its “is_item” implementation in scenarios where the corresponding extra is not installed.
I think it may be best to discuss this in a separate issue or PR, ad we may change the API, and in ny case do the same for all extras.
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.
Should we release this now or do that separate discussion first?
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’m fine with either approach.
Continuation of #86 with the following additional changes:
PydanticV1Adapter
class).docs
tox env to check the README code.Resolves #72, closes #76, closes #86.