Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Python 3.11 in CI #968

Merged
merged 2 commits into from
Nov 1, 2022
Merged

Upgrade to Python 3.11 in CI #968

merged 2 commits into from
Nov 1, 2022

Conversation

nolar
Copy link
Owner

@nolar nolar commented Oct 31, 2022

Besides, replace unittest.mock + aynctest with backported mock to support Python 3.7–3.11. The root of the conflict between 3.7 and 3.11 is asynctest, which is intensively used in the unit tests.

Python 3.11 removed @asyncio.coroutine (it was issuing warnings since Python 3.8). As a result, asynctest is completely broken in 3.11. The latest commit of asynctest is 3 years old (Nov 2019; now is Nov 2022), so asynctest can be deemed unmaintained.

The closest equivalent of asynctest is unittest.mock.AsyncMock, but it is available in Python 3.8 only. Python 3.7 can be supported with a back-ported standalone library mock. But if we use it, we should use it consistently in all places, not mixed with the StdLib's unittest.mock.

An alternative would be to drop Python 3.7 support prematurely — 8 months before its official end of life (Jun 2023) — in order to support Python 3.11 now.

@nolar nolar added the automation CI/CD: testing, linting, releasing automatically label Oct 31, 2022
@nolar nolar force-pushed the python-3.11 branch 2 times, most recently from cb7b3ab to bc7fccf Compare November 1, 2022 00:20
nolar added 2 commits November 1, 2022 01:46
…t Python 3.7–3.11

The root of the conflict between 3.7 and 3.11 is `asynctest`, which is intensively used in the unit tests.

Python 3.11 removed `@asyncio.coroutine` (it was issuing warnings since Python 3.8). As a result, `asynctest` is completely broken in 3.11. The latest commit of `asynctest` is 3 years old (Nov 2019; now is Nov 2022), so `asynctest` can be deemed unmaintained.

The closest equivalent of `asynctest` is `unittest.mock.AsyncMock`, but it is available in Python 3.8 only. Python 3.7 can be supported with a back-ported standalone library `mock`. But if we use it, we should use it consistently in all places, not mixed with the StdLib's `unittest.mock`.

An alternative would be to drop Python 3.7 support prematurely — 8 months before its official end of life (Jun 2023) — in order to support Python 3.11 now.

Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
@nolar nolar merged commit a251e84 into main Nov 1, 2022
@nolar nolar deleted the python-3.11 branch November 1, 2022 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation CI/CD: testing, linting, releasing automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant