Repository navigation
Testing Python 3.12 #7727
Copy link
Copy link
Closed
Labels
component: infrastructureIssues related to development scripts, CI, servers, etc.Issues related to development scripts, CI, servers, etc.priority: 1 - middleIssues which should be done at some point, but aren't that important.Issues which should be done at some point, but aren't that important.
Description
While we had Python 3.12 in the CI during its Alpha phase (with zero issues), now in the Beta phase it looks like things start breaking in upstream projects. Removing it from CI for now, until upstream issues are fixed. Here is what I ran into:
pytest
Shows ast deprecation warnings:
- [Python 3.12] Assertion rewriting triggers DeprecationWarning pytest-dev/pytest#10977
- Python 3.12 support pytest-dev/pytest#10894
Hidden by:
diff --git i/pytest.ini w/pytest.ini
index 46a22c5c8..899118186 100644
--- i/pytest.ini
+++ w/pytest.ini
@@ -63,4 +63,7 @@ filterwarnings =
default:Test process .* failed to terminate!:UserWarning
# https://github.com/certifi/python-certifi/issues/170
ignore:path is deprecated\. Use files\(\) instead\. Refer to https.//importlib-resources\.readthedocs\.io/en/latest/using\.html#migrating-from-legacy for migration advice\.:DeprecationWarning:certifi.core
+ # Python 3.12: https://github.com/pytest-dev/pytest/issues/10977
+ ignore:ast\.(Str|NameConstant|Num) is deprecated and will be removed in Python 3\.14; use ast\.Constant instead:DeprecationWarning
+ ignore:Attribute s is deprecated and will be removed in Python 3\.14; use value instead:DeprecationWarning
faulthandler_timeout = 90
hypothesis
Triggers syntax error:
- extract_lambda_source() fails with Python 3.12b1 HypothesisWorks/hypothesis#3665
- Add Python 3.12 beta to our CI pipeline HypothesisWorks/hypothesis#3663
I don't really see a way around this, guess we'll need to wait for either Hypothesis or (more likely based on the comment) CPython comes up with a fix for this.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component: infrastructureIssues related to development scripts, CI, servers, etc.Issues related to development scripts, CI, servers, etc.priority: 1 - middleIssues which should be done at some point, but aren't that important.Issues which should be done at some point, but aren't that important.
Activity
ci: Remove Python 3.12 for now
Zac-HD commentedon May 31, 2023
Happily the lambda source error was a bug in the standard library, and has already been fixed in cpython main.
The-Compiler commentedon May 31, 2023
Thanks for the update, @Zac-HD! Looks like beta 2 is scheduled for June 6th, so looks like we can probably reactivate the CI job in a week or so!
The-Compiler commentedon Jun 7, 2023
Beta 2 is now released - waiting for GitHub Actions to update, and then we can finally give this another try!
The-Compiler commentedon Jun 8, 2023
With this patch:
commit 0b0401f8bb23fa57bac13e14b522c9755cba05f7 Author: Florian Bruhin <me@the-compiler.org> Date: Thu Jun 8 17:38:12 2023 +0200 py312: Tell tox/virtualenv to upgrade pip Otherwise we run into a Python 3.12 incompatibility with pkg_resources: https://github.com/pypa/pip/issues/11501 Also needs PIP_REQUIRE_VIRTUALENV=0 because otherwise pip seems to falsely assume it's installing things system-wide, weirdly. Should probably be removed once there is a newer virtualenv, which vendors a newer pip, which vendors a newer pkg_resources... See #7727 diff --git a/tox.ini b/tox.ini index 3c1759eb7..606446f70 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,8 @@ setenv = pyqt{62,63,64,65}: PYTEST_QT_API=pyqt6 pyqt{62,63,64,65}: QUTE_QT_WRAPPER=PyQt6 cov: PYTEST_ADDOPTS=--cov --cov-report xml --cov-report=html --cov-report= + py312: VIRTUALENV_PIP=23.1.2 + py312: PIP_REQUIRE_VIRTUALENV=0 passenv = PYTHON DISPLAYI got things to run locally - however, now PyQt seems to segault:
The-Compiler commentedon Jun 8, 2023
I got it down to this, based on the
statusbar.command.Commandclass:Bisected in Python to gh-94673: More Per-Interpreter Fields for Builtin Static Types (gh-10… · python/cpython@de64e75.
Better stacktrace with a debug Python build:
Reported to PyQt: https://www.riverbankcomputing.com/pipermail/pyqt/2023-June/045325.html
py312: Tell tox/virtualenv to upgrade pip
py312: Ignore pytest ast warnings
Inline misc.MinimalLineEdit into statusbar.command.Command
py312: Ignore pytest-benchmark deprecation warning
The-Compiler commentedon Jun 9, 2023
I got rid of the multiple inheritance in 0fe03ae - it was making the code more complex needlessly anyways.
At least locally, now only two tests are failing with Python 3.12:
And indeed a simple
qutebrowser --versionwith Python 3.12 still segfaults on exit... Reported here: Python 3.12: "Python memory allocator called without holding the GIL" on shutdownWork around Python 3.12 test issues
Revert "ci: Remove Python 3.12 for now"
The-Compiler commentedon Jun 9, 2023
Tests run fine now - but pytest then segfaults on exit too. So removing from CI again for the time being...
The-Compiler commentedon Jul 11, 2023
python/cpython#106600 made it in just in time - Beta 4 is scheduled for yesterday but apparently wasn't released yet. So hopefully once that's out, we can give this another try on CI.
The-Compiler commentedon Jul 12, 2023
Python 3.12 Beta 4 was released, and the latest PyQt snapshot seems to run our testsuite without any issues!
Time to re-add it to the CI once Qt 6.5.2 and then PyQt 6.5.2 is out 😅
Revert "ci: Remove Python 3.12 for now"
The-Compiler commentedon Jan 23, 2024
Fixed in 6478496