Open c7hm4r opened 1 year ago
Workaround: run pip install 'pydantic<2.0'
in the virtual environment.
Workaround: run
pip install 'pydantic<2.0'
in the virtual environment.
Suggest we specify this in pyproject.toml, or change
to ^=1.7.4
.
Not sure why I didn't do this when starting to use Pydantic. I think because generally speaking it makes packagers' lives easier if we don't impose upper bounds?
Just encountered this, and in other projects as well on Friday morning. I agree with pinning to <2.0.0
as a workaround; hoping to make a PR for this shortly.
Just created: https://github.com/matrix-org/synapse/pull/15862
Closing this as it looks like it is resolved by https://github.com/matrix-org/synapse/pull/15862
Hi! We're currently blocked by matrix-synapse in our pydantic 2 rebuild for Arch Linux. Please reopen this ticket so that discussion around how/when/if to switch to pydantic2 can happen.
The change in #15862 is merely a workaround and not the solution to this ticket (which would be "be compatible with pydantic >= 2").
Thanks! :)
Re-opening per the above -- pinning to <= 2.0 isn't supporting Pydantic 2.0.
Pydantic V2 includes V1 built-in to help migration.
We could use the following all over the place as a transitional measure.
try:
from pydantic import v1 as pydantic
except ImportError:
import pydantic
Given that V1 and V2 use the same Python package name (⇒ you can't have them both installed at the same time), we sadly can expect some trouble with distro packages that would make switching to using V2 proper difficult for some time.
We could use the following all over the place as a transitional measure.
I'm not sure if that really works as intended. There are some implied breakages AFAIK irt the validators.
I can earliest look at my open PR again after 2023-08-21. If someone manages to fix this earlier and create a new release, that would be much appreciated, as synapse is currently the only package blocking us from moving to pydantic v2 on Arch Linux: https://archlinux.org/todo/python-pydantic-2/
We could use the following all over the place as a transitional measure.
I'm not sure if that really works as intended. There are some implied breakages AFAIK irt the validators.
The pydantic.v1
module is simply a copy of the old pydantic v1 code, so there should not be breakages there.
I opened https://github.com/matrix-org/synapse/pull/16332 to add support for pydantic v2 while maintaining support for v1.
I opened #16332 to add support for pydantic v2 while maintaining support for v1.
I re-titled this since Synapse is now compatible, but not taking advantage of pydantic v2.
Description
After upgrading the PIP packages, Synapse failed to launch.
Steps to reproduce
matrix-synapse
using the "virtualenv" approach with the most recent dependency versionsHomeserver
another homeserver
Synapse Version
1.87.0rc1
Installation Method
pip (from PyPI)
Database
PostgreSQL
Workers
Single process
Platform
Raspberry Pi OS (Debian)
Configuration
No response
Relevant log output
Anything else that would be useful to know?
pydantic
2.0 was released yesterday