Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use Python 3.12 for asyncio CI #16685

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .ci/scripts/calculate_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def set_output(key: str, value: str):
"workers": "workers",
},
{
"sytest-tag": "focal",
"sytest-tag": "mantic-3.12",
"postgres": "multi-postgres",
"workers": "workers",
"reactor": "asyncio",
Expand All @@ -121,11 +121,11 @@ def set_output(key: str, value: str):
sytest_tests.extend(
[
{
"sytest-tag": "focal",
"sytest-tag": "mantic-3.12",
"reactor": "asyncio",
},
{
"sytest-tag": "focal",
"sytest-tag": "mantic-3.12",
"postgres": "postgres",
"reactor": "asyncio",
},
Expand Down
1 change: 1 addition & 0 deletions changelog.d/16685.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use Python 3.12 for asyncio CI.
48 changes: 46 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ pydantic = ">=1.7.4, <3"
# needed.
setuptools_rust = ">=1.3"

uvloop = ">=0.19.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the reactor tick timing stuff won't work with uvloop. I think I tried to support it briefly and then decided we probably weren't going to use it...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful context! Was mainly wondering if using a different event loop would change how fast it'd run, but alas not. I guess there is just some extra overhead maybe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the asyncio reactor you end up doing some bookkeeping twice, which is annoying. I'm kind of surprised it is that much of a difference though, I wish we had a good benchmark for running this through instead of sytest.



# Optional Dependencies
# ---------------------
Expand Down
4 changes: 4 additions & 0 deletions synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

import asyncio

import uvloop

asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())

from twisted.internet import asyncioreactor

asyncioreactor.install(asyncio.get_event_loop())
Expand Down
Loading