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

⬆️ Upgrade pydantic to v2 #72

Merged
merged 44 commits into from
May 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
16e5115
:art: organise imports with isort
ff137 Aug 19, 2023
c56f48e
:arrow_up: upgrade pydantic to v2.2
ff137 Aug 19, 2023
e57e36b
version bump to `0.5.0`
ff137 Aug 19, 2023
5262505
update lock file
ff137 Aug 19, 2023
8667b96
replace `GenericModel` with `BaseModel`, as v2 makes GenericModel unn…
ff137 Aug 19, 2023
ddd8cac
replace deprecated validators with `field_validator` and `model_valid…
ff137 Aug 19, 2023
e2bc30e
replace custom Config class with new `model_config` and `ConfigDict`
ff137 Aug 19, 2023
84673bf
update deprecated `__get_validators__` and `__modify_schema__` with n…
ff137 Aug 19, 2023
7adf5c6
replace deprecated `validate` with `model_validate`
ff137 Aug 19, 2023
f5e63b7
replace deprecated `.dict` and `.json` with `model_dump` and `model_d…
ff137 Aug 19, 2023
e15c1c8
implement `TypeAdapter` for validating/serialising non-BaseModel type…
ff137 Aug 19, 2023
7ed0c95
replace deprecated `construct` with `model_construct`
ff137 Aug 19, 2023
d3e33ae
replace deprecated `__fields__` with `model_fields`
ff137 Aug 19, 2023
4cc41a0
replace custom Config class with new `model_config` and `ConfigDict`.…
ff137 Aug 19, 2023
b872c21
rename `validate` method to `model_validate`, for consistency with py…
ff137 Aug 19, 2023
a708272
:art: fix ruff warnings
ff137 Mar 26, 2024
d027189
:arrow_up: Update `pydantic` to latest
ff137 Mar 26, 2024
24e65c5
Update lock file
ff137 Mar 26, 2024
7f7f0eb
:art: replace deprecated "Extra" field
ff137 Mar 26, 2024
457c7f5
:art: ignore pylance warning
ff137 Mar 26, 2024
a2b0ace
:art: rename `mock_indexed_resource_factory` for clarity, and add typ…
ff137 Mar 26, 2024
db81923
:art: update expected json output
ff137 Mar 26, 2024
ccde93e
:art: fix model_validators to handle Union[dict, Model] values types
ff137 Mar 26, 2024
8fce05b
:art: black formatting
ff137 Apr 12, 2024
27a8381
:arrow_up: Upgrade pydantic to 2.7.0
ff137 Apr 12, 2024
0921fb1
Update lock file
ff137 Apr 12, 2024
0b1e204
:art: black formatting
ff137 Apr 12, 2024
4b2c4c8
:bug: this model validator should be "after"
ff137 Apr 25, 2024
1ad87da
:art: add type to listify
ff137 Apr 25, 2024
8657167
:art:
ff137 Apr 25, 2024
8960744
:art: neaten type adapter dereferencing
ff137 Apr 25, 2024
472a157
:art: typing for field_validator methods
ff137 Apr 25, 2024
9d9d767
:bug: fix _method_appears_to_contain_material
ff137 Apr 25, 2024
0af333f
:bug: fix model validators must all be "before" (!!!)
ff137 Apr 25, 2024
366f4ca
:bug: fix required_group logic for pydantic v2
ff137 Apr 25, 2024
9a13aec
:bug: fix model_fields usage in pydantic v2
ff137 Apr 25, 2024
00c2c38
:white_check: fix test -- dereference as the known type. Dereferencin…
ff137 Apr 25, 2024
64e8288
:sparkles: fix material prop validator to handle fact that model para…
ff137 Apr 25, 2024
cb3cb8d
:rewind: revert change; Deserializing to `KnownVerificationMethods` d…
ff137 Apr 25, 2024
1ec56b2
Update lock file
ff137 Apr 25, 2024
75de2ed
:art: re-add `DID.validate` method for backward compatibility
ff137 Apr 26, 2024
455118a
Update lock file
ff137 Apr 26, 2024
ebc5c4f
:art:
ff137 Apr 26, 2024
51c2475
Merge remote-tracking branch 'upstream/main' into upgrade/pydantic
ff137 May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🎨 update expected json output
Signed-off-by: ff137 <[email protected]>
ff137 committed Apr 25, 2024
commit db819233803b2b00634fc8c18c41472ed308f7f4
2 changes: 1 addition & 1 deletion tests/test_resource.py
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ def test_resource_json_transforms():
class Test(Resource):
one: str

assert Test(one="test").to_json() == '{"one": "test"}'
assert Test(one="test").to_json() == '{"one":"test"}'
assert Test.from_json('{"one": "test"}') == Test(one="test")