Update pydantic requirement from <2.0.0,>=1.8.0 to >=1.8.0,<3.0.0
Updates the requirements on pydantic to permit the latest version.
Release notes
Sourced from pydantic's releases.
v2.0 2023-06-30
What's Changed
- 📝 Don't recomend to use
TypeErroron validators by@Kludexin pydantic/pydantic#6179- 📝 Add docs about custom error messages by
@Kludexin pydantic/pydantic#6182- Change allow mutation wording by
@mark-toddin pydantic/pydantic#6184- 📝 Improve fields documentation by
@Kludexin pydantic/pydantic#6183- Ignore deprecated methods of
pydantic.mainin pydocstyle check by@hramezaniin pydantic/pydantic#6185- Another solution to custom getattr/delattr by
@dmontaguin pydantic/pydantic#6165- 🐛 Fix
RootModeldefault values by@ligin pydantic/pydantic#5949- Improve conversion_table by
@hramezaniin pydantic/pydantic#6186- Uncomment
from_ormdeprecateddecorator by@hramezaniin pydantic/pydantic#6189- Complete
pydantic/root_model.pydocstring by@hramezaniin pydantic/pydantic#6193- Complete
pydantic/functional_validators.pydocstrings by@hramezaniin pydantic/pydantic#6191- Fix access of 'required' key for TypedDictField in GenerateJsonSchema by
@adriangbin pydantic/pydantic#6200- 💚 Use the same conditions on
send_tweetasreleaseby@Kludexin pydantic/pydantic#6170- 📝 Add migration reference to the "Import Error" section by
@Kludexin pydantic/pydantic#6208- Improve
pydantic/mypy.pydocstring by@hramezaniin pydantic/pydantic#6207- 📝 Update documentation about "Number Types" by
@Kludexin pydantic/pydantic#6211- Don't sort model keys by
@adriangbin pydantic/pydantic#6212- Add documentation for strict mode by
@tpdorseyin pydantic/pydantic#6196- Add documentation for strict types by
@tpdorseyin pydantic/pydantic#6218- Update serialization decorator documentation by
@tpdorseyin pydantic/pydantic#6216- Update list and set docs by
@dmontaguin pydantic/pydantic#6142- Update docs for sequence_iterable by
@dmontaguin pydantic/pydantic#6220- 👷 Add Integration CI workflow for
pydantic-settingsby@ligin pydantic/pydantic#6221- ⬆ Upgrade to pydantic-core 0.41.0 by
@ligin pydantic/pydantic#6219- Document Strict on Annotated fields by
@tpdorseyin pydantic/pydantic#6223- 🐛 Fix crash on serializing a union of RootModel and BaseModel by
@ligin pydantic/pydantic#6201- Run docstring tests by
@dmontaguin pydantic/pydantic#6175- Add documentation for PlainSerializer and WrapSerializer by
@tpdorseyin pydantic/pydantic#6230- Improve mypy documentation by
@hramezaniin pydantic/pydantic#6226- 🚸 Improve error message when BaseSettings is imported by
@Kludexin pydantic/pydantic#6229- correct deprecation warning for parse_file by
@davidhewittin pydantic/pydantic#6228- Update migration docs to include a note about
parse_env_varremoval by@hramezaniin pydantic/pydantic#6235- Add warning about datamodel-code-generator to docs by
@hramezaniin pydantic/pydantic#6236- PYD-124: improve docs for
__get_pydantic_core_schema__by@adriangbin pydantic/pydantic#6224- Minor edits from review of Enum docs by
@tpdorseyin pydantic/pydantic#6238- Update and consolidate links in number types by
@tpdorseyin pydantic/pydantic#6239- Update V2 vs V1 section in README.md by
@adriangbin pydantic/pydantic#6242- Add type key to enums by
@adriangbin pydantic/pydantic#6243- 🐛 Restrict range on Python version for
_make_forward_refby@Kludexin pydantic/pydantic#6246- 💚 Add timeout on
publish_docsjob by@Kludexin pydantic/pydantic#6247- 👷 Enable FastAPI tests by
@Kludexin pydantic/pydantic#6249- docs: use _pydantic_core.pyi as only docs source for now by
@davidhewittin pydantic/pydantic#6257- Reorder basemodel methods by
@dmontaguin pydantic/pydantic#6260- Improve file type docs by
@hramezaniin pydantic/pydantic#6252- 🔧 Add
assigneeslist to the hooky config by@ligin pydantic/pydantic#6264- Document "wrap" validators by
@tpdorseyin pydantic/pydantic#6258- Update validate_call documentation by
@tpdorseyin pydantic/pydantic#6255- 📝 Update docs about hypothesis by
@Kludexin pydantic/pydantic#6266
... (truncated)
Changelog
Sourced from pydantic's changelog.
v2.0 (2023-06-30)
Pydantic V2 is here! :tada:
See this post for more details.
See the full changelog here
v2.0b3 (2023-06-16)
Third beta pre-release of Pydantic V2
See the full changelog here
v2.0b2 (2023-06-03)
Add
from_attributesruntime flag toTypeAdapter.validate_pythonandBaseModel.model_validate.See the full changelog here
v2.0b1 (2023-06-01)
First beta pre-release of Pydantic V2
See the full changelog here
v2.0a4 (2023-05-05)
Fourth pre-release of Pydantic V2
See the full changelog here
v2.0a3 (2023-04-20)
Third pre-release of Pydantic V2
See the full changelog here
v2.0a2 (2023-04-12)
Second pre-release of Pydantic V2
See the full changelog here
v2.0a1 (2023-04-03)
First pre-release of Pydantic V2!
See this post for more details.
... (truncated)
Commits
aeb8fd0fix publish_docs492db2aUse exclude in pyproject.toml with black (#6316)aee6986Prepare for release (#6319)08c473aIndex improvements (#6314)89032e1Remove warning on top ofdocs/usage/types/callables.md(#6318)c143ecdPYD-131 Links between API and usage docs (#6307)119b9f5Update mypy plugin (#6306)b1f689epydantic-core 2.0.1 (#6310)f2b866f📝 Add note about page not up-to-date (#6312)0bc0e87adding page about version compatibility (#6309)- Additional commits viewable in compare view
You can trigger a rebase of this PR by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Assigning to self, as I'll need to update how pydantic is used in the saving tests for this PR.
@ascillitoe sounds like this is a major (breaking) version (although I haven't found a good place describing all the new stuff). I suppose for us we would want to upgrade to >=2.0 instead of also allowing an older version (unless we can make the required changes in a way that works with both 1.x and 2.x?). However, if we do that, then need to check how this might interact on e.g. mlserver runtimes with a different pydantic version.
Yeh it involves some moderate changes, I actually tried to do this today and stopped since realised it was a bigger job than first expected.
Their is a migration tool bump-pydantic, but it didn't work properly when I tried it. To support v2 I'd need to rewrite the validators in saving/validators.py, and a few bits in saving/schemas.py. I'm not 100% sure but don't think we'll be able to rewrite the pydantic stuff to work in v1 and v2, I think we'd have to have separate v1 and v2 pydantic models.
According to this, we have a year to make the jump, so it might be worth leaving this for a while? Some of our deps such as thinc are also still on v1.x so we can't make the move just yet anyway.
p.s. good point about mlserver...
Superseded by https://github.com/SeldonIO/alibi-detect/pull/882. Everything else about needing to do an actual migration still stands, of course!
Hello, thinc now supports pydantic>=1.7.4,!=1.8,!=1.8.1,<3.0.0. What is your roadmap regarding the pydantic version bump? I'm using pydantic~=2.0 and I cannot use your library because of that :( .
Hi @MarcBresson, with https://github.com/SeldonIO/alibi-detect/pull/882, you should be able to use Alibi Detect with Pydantic v1 or v2! We haven't done a release yet though. Are you able to use a commit hash or branch to specify the version of Alibi Detect that you use?
Thank you for your quick answer! It worked like a charm with https://github.com/SeldonIO/alibi-detect/archive/master.zip in my requirements file.
Will change it back later when the new version has been released.
@MarcBresson: No worries mate! Thank you too for confirming that that worked.