Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7fe7d4b
Use pydantic imports directly
V02460 Oct 15, 2025
6d4fb7e
Apply conflict-free pydantic migrations
V02460 Oct 15, 2025
4022d21
Add debugging infos to asserts
V02460 Oct 17, 2025
123fe26
Migrate to pydantic v2
V02460 Oct 17, 2025
32ea42a
Enable strict mode
V02460 Oct 17, 2025
a7a5549
Update pyproject.toml
V02460 Oct 17, 2025
8879e00
Add newsfragment
V02460 Oct 17, 2025
1bb5a63
Remove lint-pydantic CI job
V02460 Oct 17, 2025
6183c4f
Bump pydantic to support Python 3.14
V02460 Oct 18, 2025
4ac5722
Apply suggestions from code review
V02460 Oct 21, 2025
ab66dc1
Remove upper version bound for typing-extensions
V02460 Oct 21, 2025
865ecf2
Return more generic HTTP error for email requests
V02460 Oct 21, 2025
ee08ddc
Use older Pydantic version for Python < 3.14
V02460 Oct 21, 2025
f04e690
Use model_validate instead of deprecated parse_obj
V02460 Oct 22, 2025
454b3a7
Update parse_obj_as to TypeAdapter.validate_python
V02460 Oct 22, 2025
e6eed4b
Disable strict mode for room topic content
V02460 Oct 22, 2025
bae991f
Allow tuples for m.text
V02460 Oct 22, 2025
80e3e8f
Merge branch 'develop' into pydantic-v2
V02460 Oct 22, 2025
5a4eb77
REVERT: Add support for markers to `check_dependencies.py`
anoadragon453 Oct 28, 2025
e02beb1
Merge branch 'develop' of github.com:element-hq/synapse into pydantic-v2
anoadragon453 Oct 28, 2025
2719f33
Try removing strict Field annotation to fix olddeps
anoadragon453 Oct 28, 2025
13fe3fa
Use a `list` rather than `set` in Pydantic model
anoadragon453 Oct 29, 2025
59d6adf
Revert "REVERT: Add support for markers to `check_dependencies.py`"
anoadragon453 Oct 29, 2025
82c77a9
Remove obsolete Pydantic dev dependency
V02460 Oct 29, 2025
ef83757
Merge branch 'develop' into pydantic-v2
V02460 Oct 29, 2025
3795728
Merge branch 'develop' into pydantic-v2
anoadragon453 Oct 30, 2025
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
22 changes: 0 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,26 +207,6 @@ jobs:
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}

lint-pydantic:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.linting == 'true' }}

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- uses: matrix-org/setup-python-poetry@5bbf6603c5c930615ec8a29f1b5d7d258d905aa4 # v2.0.0
with:
poetry-version: "2.1.1"
extras: "all"
- run: poetry run scripts-dev/check_pydantic_models.py

lint-clippy:
runs-on: ubuntu-latest
needs: changes
Expand Down Expand Up @@ -341,7 +321,6 @@ jobs:
- lint-mypy
- lint-crlf
- lint-newsfile
- lint-pydantic
- check-sampleconfig
- check-schema-delta
- check-lockfile
Expand All @@ -363,7 +342,6 @@ jobs:
lint
lint-mypy
lint-newsfile
lint-pydantic
lint-clippy
lint-clippy-nightly
lint-rust
Expand Down
1 change: 1 addition & 0 deletions changelog.d/19071.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update pydantic to v2.
294 changes: 156 additions & 138 deletions poetry.lock

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ netaddr = ">=0.7.18"
Jinja2 = ">=3.0"
# 3.2.0 updates collections.abc imports to avoid Python 3.10 incompatibility.
bleach = ">=3.2.0"
# We use `assert_never`, which were added in `typing-extensions` 4.1.
typing-extensions = ">=4.1"
# pydantic 2.12 depends on typing-extensions>=4.14.1
typing-extensions = ">=4.14.1"
# We enforce that we have a `cryptography` version that bundles an `openssl`
# with the latest security patches.
cryptography = ">=3.4.7"
Expand All @@ -230,9 +230,10 @@ ijson = ">=3.1.4"
matrix-common = "^1.3.0"
# We need packaging.verison.Version(...).major added in 20.0.
packaging = ">=20.0"
# We support pydantic v1 and pydantic v2 via the pydantic.v1 compat module.
# See https://github.com/matrix-org/synapse/issues/15858
pydantic = ">=1.7.4, <3"
pydantic = [
{ version = "~=2.8", python = "<3.14" },
{ version = "~=2.12", python = ">=3.14" },
]

# This is for building the rust components during "poetry install", which
# currently ignores the `build-system.requires` directive (c.f.
Expand Down Expand Up @@ -335,8 +336,6 @@ all = [
# can bump versions without having to update the content-hash in the lockfile.
# This helps prevents merge conflicts when running a batch of dependabot updates.
ruff = "0.12.10"
# Type checking only works with the pydantic.v1 compat module from pydantic v2
pydantic = "^2"

# Typechecking
lxml-stubs = ">=0.4.0"
Expand Down
Loading