forked-synapse/synapse
Éloi Rivard ebad618bf0
import pydantic objects from the _pydantic_compat module (#17667)
This PR changes `from pydantic import BaseModel` to `from
synapse._pydantic_compat import BaseModel` (as well as `constr`,
`conbytes`, `conint`, `confloat`).

It allows `check_pydantic_models.py` to mock those pydantic objects only
in the synapse module, and not interfere with pydantic objects in
external dependencies.

This should solve the CI problems for #17144, which breaks because
`check_pydantic_models.py` patches pydantic models from
[scim2-models](https://scim2-models.readthedocs.io/).

/cc @DMRobertson @gotmax23
fixes #17659 


### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
  - Use markdown where necessary, mostly for `code blocks`.
  - End with either a period (.) or an exclamation mark (!).
  - Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct
(run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
2024-09-11 21:01:43 +00:00
..
_scripts Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
api Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
app Sliding sync: Store the per-connection state in the database. (#17599) 2024-08-30 15:31:05 +01:00
appservice Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
config import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
crypto Fix fetching signing keys when old_verify_keys is omitted (#17568) 2024-08-14 14:13:56 +01:00
events import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
federation Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
handlers Sliding Sync: Use Sliding Sync tables for sorting (#17693) 2024-09-11 12:16:24 -05:00
http import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
logging Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
media Fix content length on federation /thumbnail responses (#17532) 2024-08-28 11:29:12 +01:00
metrics Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
module_api Bump mypy from 1.5.1 to 1.8.0 (#16901) 2024-03-13 17:05:57 +00:00
push Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
replication Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
res Send an email if the address is already bound to an user account (#16819) 2024-04-23 16:45:24 +01:00
rest import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
server_notices Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
spam_checker_api Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
state Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
static Update link to the clients webpage, fix #15825 (#15874) 2023-07-06 17:28:09 +02:00
storage import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
streams Fix regression when bounding future tokens (#17391) 2024-07-02 14:06:36 +01:00
synapse_rust Add event.internal_metadata.instance_name (#17300) 2024-06-13 11:32:50 -05:00
types import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
util Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
__init__.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
_pydantic_compat.py import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
event_auth.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
notifier.py Reduce volume of 'Waiting for current token' logs, which were introduced in v1.109.0. (#17428) 2024-07-23 11:51:34 +01:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Register the media threadpool with our metrics (#17566) 2024-08-14 15:11:22 +01:00
visibility.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00