aio-libs / aiomonitor

aiomonitor is module that adds monitor and python REPL capabilities for asyncio application
https://aiomonitor.aio-libs.org
Apache License 2.0
662 stars 42 forks source link

Improve Python 3.12 compatibility #389

Closed achimnol closed 12 months ago

achimnol commented 12 months ago

What do these changes do?

It improves Python 3.12 compatibility.

This PR relaxes our direct dependency to aiohttp to allow 3.9 and higher, by changing the requirement expression from ~=3.8.5 to >=3.8.5, while pinning its version to 3.9.1 in requirements-dev.txt used for local development and CI/CD tests. It also pins the uvloop version to 0.19.0 in the same way.

setup.cfg (relaxed, minimum only) requirements-dev.txt (pinned for dev & CI)
aiohttp>=3.8.5 aiohttp==3.9.1
uvloop>=0.17.0 uvloop==0.19.0
aioconsole>=0.7.0 aioconsole==0.7.0

aiomonitor is a library that can be used various combinations of Python and aiohttp versions. The new aiohttp 3.9 release is required to run on Python 3.12, and there is no critical need to hold the aiohttp version back to the 3.8.x series to serve our webui.

In general, it is better to set the minimum compatible versions on our dependencies to maximize the dependency compatibility unless there are known critical regressions on specific versions.

This PR also sets the minimum required version of aioconsole to 0.7.0, to avoid the incompatibility issue with Python 3.11.7+ and 3.12.1+ (vxgmichel/aioconsole#114).

Are there changes in behavior for the user?

No.

Checklist

webknjaz commented 12 months ago

@achimnol I think it's the RTD requirement that is not yet compatible with merge queues: https://github.com/orgs/aio-libs/discussions/27#discussioncomment-7395467. We may have to drop it from the required checks.

Could you +1 this request? https://github.com/readthedocs/readthedocs.org/issues/10021

achimnol commented 12 months ago

@achimnol I think it's the RTD requirement that is not yet compatible with merge queues: github.com/orgs/aio-libs/discussions/27#discussioncomment-7395467. We may have to drop it from the required checks.

Could you +1 this request? readthedocs/readthedocs.org#10021

Just added a +1 there!

achimnol commented 12 months ago

After this, I'm going to update requirements-dev.txt to work with Python 3.12 as well via a separate PR.

achimnol commented 12 months ago

Ah... RTD is blocking the merge queue.... 😞 @webknjaz Until the RTD-side issue is resolved, could you temporarily remove RTD build from the required checks?

achimnol commented 12 months ago

Ummm... the test failure turned out to be a new regression introduced in Python 3.11.7 as GitHub Action began to use it. In my local setup, the test passes with Python 3.11.6 and breaks with Python 3.11.7...... T_T

achimnol commented 12 months ago

Currently blocked by vxgmichel/aioconsole#114