Repository navigation
Add PyQt6 and PySide6 CI workflows (and fix the hanging SnapshotTool test) - #87
Merged
Merged
Conversation
Since the fix of #58, SnapshotTool defers its action with a zero-delay timer. In test_annotation_tools, this action ran during the processEvents() call of guidata's exec_dialog, before the automatic closing of dialogs was scheduled, so the modal ResizeDialog opened by save_snapshot was never closed and the test hung. The test only passed under PyQt5 on Linux when run after another test, whose pending closing timer closed the dialog; it hung when run on its own, on Windows, and with PyQt6 or PySide6. In unattended mode, replace the snapshot action by a recorder, run the deferred actions within the test, and check that the action was called once with the plot and an oriented rectangle. Assisted-by: Claude Opus 5.5
Add test_pyqt6.yml and test_pyside6.yml, based on test_pyqt5.yml as in guidata: Python 3.10 and 3.14, additional system libraries required by Qt 6, and a 20-minute timeout so that a hanging test does not hold a runner for hours. As in guidata and PythonQwt, PySide6 6.12.0 is excluded before Python 3.12, where it crashes. Pull requests now select the guidata and PythonQwt versions to test against from their target branch (github.base_ref), as pushes do from their own branch: pull requests to develop or release were tested against the versions published on PyPI, since github.ref_name is "<number>/merge" for them. The PyQt6 tests are also required before uploading a release to PyPI, as in guidata. Closes #69 Assisted-by: Claude Opus 5.5
Test the lowest and highest supported Python versions, as the PyQt6 and PySide6 workflows do. Assisted-by: Claude Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #69
What
test_pyqt6.ymlandtest_pyside6.yml, based ontest_pyqt5.ymlas in guidata:libegl1 libgl1 libopengl0 libxcb-cursor0);timeout-minutes: 20, so that a hanging test cannot hold a runner for 6 hours;PySide6!=6.12.0before Python 3.12, where 6.12.0 crashes), so Python 3.10 tests PySide6 6.11.x and Python 3.14 tests 6.12.0.github.base_ref || github.ref_name. Before,github.ref_nameis<number>/mergeon pull requests, so PRs todeveloporreleasewere tested against guidata and PythonQwt from PyPI instead of their development branches.build_deploy.ymlnow also requires the PyQt6 tests before uploading to PyPI (as guidata does; PySide6 is not required, as in guidata).test_annotation_tools.py::test_tool[SnapshotTool]no longer hangs.release_2.12.md(🔧 Other changes).Why the test fix is needed
Adding the Qt 6 workflows as is makes the CI hang. Since the fix of #58,
SnapshotTooldefers its action withQTimer.singleShot(0, ...). Intest_annotation_tools, this action ran during theprocessEvents()call of guidata'sexec_dialog, before the automatic closing of dialogs was scheduled, so the modalResizeDialogopened bysave_snapshotwaited forever.The test only passed with PyQt5 on Linux, and only when run after another test, whose pending closing timer happened to close the dialog. It hung when run on its own (even with PyQt5 on Linux), on Windows with all bindings, and with PyQt6 or PySide6 on Linux.
The test now replaces the snapshot action by a recorder in unattended mode, runs the deferred actions within the test, and checks that the action was called once, with the plot and an oriented rectangle. The production code is unchanged, and the real snapshot dialogs are still used when the test is run interactively.
Local validation
test_pyqt6.yml, Python 3.10 / 3.14 (PyQt6 6.12.0)test_pyside6.yml, Python 3.10 (PySide6 6.11.3) / 3.14 (PySide6 6.12.0)The Linux replays ran the install script of each workflow (development dependencies: guidata
develop, PythonQwtmaster),ruff checkand the fullpytestsuite, without deselecting any test. The extra skipped test with PySide6 istest_qtdesigner.py(QtDesigner plugins are not supported by PySide6).actionlintreports no new issue.After merging, #69 has to be closed manually, since this PR targets
developand the default branch ismaster.