Closed gotmax23 closed 1 year ago
See also #16331.
@clokep, do you mind approving the CI run?
It looks like one of the CI jobs is failing too: https://github.com/matrix-org/synapse/actions/runs/6230975624/job/16994483499#step:10:32
It looks like one of the CI jobs is failing too: https://github.com/matrix-org/synapse/actions/runs/6230975624/job/16994483499#step:10:32
Those tests are running with packaging==16.1
from 2016 :fearful:. Can this be updated to at least version 20 from 2019 that has https://github.com/pypa/packaging/commit/f1b2b2222c8832a5a01f328afb46c9f898e67a1e?
I pushed to address the merge conflicts and feedback. @clokep, can you please approve CI again :slightly_smiling_face:?
It looks like one of the CI jobs is failing too: https://github.com/matrix-org/synapse/actions/runs/6230975624/job/16994483499#step:10:32
Those tests are running with
packaging==16.1
from 2016 😨. Can this be updated to at least version 20 from 2019 that has pypa/packaging@f1b2b22?
I bumped the minimum packaging version.
Alpine packager: ACK
Gentoo: ACK, tested with pydantic 1.10.12 and 2.3.0.
Just need CI to churn and this is good to go. 👍
Thanks @clokep!
Add support for pydantic v2 via pydantic.v1 compat module
This adds support for pydantic v2 by using the
pydantic.v1
compat module when pydantic v2 is installed and otherwise falling back to thepydantic
module.In order to satisfy mypy, we only import
pydantic.v1
during type checking. This allows proper type checking without needing to clutter the code withtype: ignores
.Once some time is passed, we can entirely drop compatibility for pydantic v1 and start using the actual pydantic v2 code to reap the additional performance benefits and other improvements of pydantic v2.
Relates: https://github.com/matrix-org/synapse/issues/15858
(I didn't use
Fixes:
, as we should track enabling full support for pydantic v2)Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.