Skip to content

Commit d9b9efa

Browse files
committed
Add support for python 3.11
Exclude python versions incompatible with qt backend libs Always get a qt backend in local venv, ignoring runner site-packages
1 parent 990e7ba commit d9b9efa

3 files changed

Lines changed: 28 additions & 11 deletions

File tree

.github/workflows/main.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,30 @@ jobs:
1919
runs-on: ${{ matrix.image }}
2020
strategy:
2121
matrix:
22-
os: [Ubuntu, Windows, MacOS]
23-
python-version: ["3.8", "3.9", "3.10"]
22+
os: [ubuntu, windows, macos-x86_64, macos-arm64]
23+
python-version: ["3.8", "3.9", "3.10", "3.11"]
2424
qt-version: ["pyside2", "pyside6", "pyqt5", "pyqt6"]
2525
include:
26-
- os: Ubuntu
26+
- os: ubuntu
2727
image: ubuntu-24.04
28-
- os: Windows
28+
- os: windows
2929
image: windows-2022
30-
- os: MacOS
30+
- os: macos-x86_64
31+
image: macos-13
32+
- os: macos-arm64
3133
image: macos-14
34+
exclude:
35+
# pyside2 does not publish arm64 packages
36+
- os: macos-arm64
37+
qt-version: pyside2
38+
# pyside2 requires python <3.11
39+
- python-version: "3.11"
40+
qt-version: pyside2
41+
# pyside6 and pyqt6 require python >=3.9
42+
- python-version: "3.8"
43+
qt-version: pyside6
44+
- python-version: "3.8"
45+
qt-version: pyqt6
3246
fail-fast: false
3347
defaults:
3448
run:
@@ -52,15 +66,15 @@ jobs:
5266
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.4 python - -y
5367
5468
- name: Update Path
55-
if: ${{ matrix.os != 'Windows' }}
69+
if: ${{ matrix.os != 'windows' }}
5670
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
5771

5872
- name: Update Path for Windows
59-
if: ${{ matrix.os == 'Windows' }}
73+
if: ${{ matrix.os == 'windows' }}
6074
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
6175

6276
- name: Enable long paths on Windows
63-
if: ${{ matrix.os == 'Windows' }}
77+
if: ${{ matrix.os == 'windows' }}
6478
run: git config --system core.longpaths true
6579

6680
- name: Configure poetry
@@ -76,7 +90,7 @@ jobs:
7690
- name: Valdate cache
7791
if: steps.cache.outputs.cache-hit == 'true'
7892
run: |
79-
# `timeout` is not available on macOS, so we define a custom function.
93+
# `timeout` is not available on macos, so we define a custom function.
8094
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
8195
8296
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
@@ -92,10 +106,10 @@ jobs:
92106
# run: poetry run mypy
93107

94108
- name: Install Qt
95-
run: poetry run pip install ${{ matrix.qt-version }}
109+
run: poetry run pip install --ignore-installed ${{ matrix.qt-version }}
96110

97111
- name: Install libxcb dependencies
98-
if: ${{ matrix.os == 'Ubuntu' }}
112+
if: ${{ matrix.os == 'ubuntu' }}
99113
env:
100114
DEBIAN_FRONTEND: noninteractive
101115
run: |

qasync/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ def close(self):
452452
self._read_notifiers.values(), self._write_notifiers.values()
453453
):
454454
notifier.setEnabled(False)
455+
notifier.activated["int"].disconnect()
455456

456457
self._read_notifiers = None
457458
self._write_notifiers = None
@@ -596,6 +597,7 @@ def __on_notifier_ready(self, notifiers, notifier, fd, callback, args):
596597
callback,
597598
)
598599
notifier.setEnabled(False)
600+
notifier.activated["int"].disconnect()
599601
return
600602

601603
# It can be necessary to disable QSocketNotifier when e.g. checking

tests/test_qeventloop.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ def cb3():
587587
nonlocal result3
588588
assert result3 is None
589589
result3 = c_sock.recv(1)
590+
loop._remove_reader(c_sock.fileno())
590591
client_done.set_result(True)
591592

592593
loop._add_reader(c_sock.fileno(), cb1)

0 commit comments

Comments
 (0)