Skip to content

Commit f668729

Browse files
authored
Merge branch 'master' into py316-deprecate
2 parents 3c4c001 + 819a630 commit f668729

11 files changed

Lines changed: 592 additions & 302 deletions

File tree

.github/workflows/main.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,34 @@ jobs:
1919
runs-on: ${{ matrix.image }}
2020
strategy:
2121
matrix:
22-
os: [Ubuntu, Windows, MacOS]
23-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
22+
os: [ubuntu, windows, macos-x86_64, macos-arm64]
23+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
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
32-
- os: MacOS
34+
exclude:
35+
# pyside2 does not publish arm64 packages
36+
- os: macos-arm64
3337
qt-version: pyside2
34-
image: macos-13
38+
# pyside2 requires python <3.11
39+
- python-version: "3.11"
40+
qt-version: pyside2
41+
- python-version: "3.12"
42+
qt-version: pyside2
43+
- python-version: "3.13"
44+
qt-version: pyside2
45+
# pyside6 and pyqt6 require python >=3.9
46+
- python-version: "3.8"
47+
qt-version: pyside6
48+
- python-version: "3.8"
49+
qt-version: pyqt6
3550
fail-fast: false
3651
defaults:
3752
run:
@@ -55,22 +70,22 @@ jobs:
5570
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.4 python - -y
5671
5772
- name: Update Path
58-
if: ${{ matrix.os != 'Windows' }}
73+
if: ${{ matrix.os != 'windows' }}
5974
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
6075

6176
- name: Update Path for Windows
62-
if: ${{ matrix.os == 'Windows' }}
77+
if: ${{ matrix.os == 'windows' }}
6378
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
6479

6580
- name: Enable long paths on Windows
66-
if: ${{ matrix.os == 'Windows' }}
81+
if: ${{ matrix.os == 'windows' }}
6782
run: git config --system core.longpaths true
6883

6984
- name: Configure poetry
7085
run: poetry config virtualenvs.in-project true
7186

7287
- name: Setup cache
73-
uses: actions/cache@v3
88+
uses: actions/cache@v4
7489
id: cache
7590
with:
7691
path: .venv
@@ -79,7 +94,7 @@ jobs:
7994
- name: Valdate cache
8095
if: steps.cache.outputs.cache-hit == 'true'
8196
run: |
82-
# `timeout` is not available on macOS, so we define a custom function.
97+
# `timeout` is not available on macos, so we define a custom function.
8398
[ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
8499
85100
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
@@ -95,10 +110,10 @@ jobs:
95110
# run: poetry run mypy
96111

97112
- name: Install Qt
98-
run: poetry run pip install ${{ matrix.qt-version }}
113+
run: poetry run pip install --ignore-installed ${{ matrix.qt-version }}
99114

100115
- name: Install libxcb dependencies
101-
if: ${{ matrix.os == 'Ubuntu' }}
116+
if: ${{ matrix.os == 'ubuntu' }}
102117
env:
103118
DEBIAN_FRONTEND: noninteractive
104119
run: |

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# qasync
22

3-
[![Maintenance](https://img.shields.io/maintenance/yes/2023)](https://pypi.org/project/qasync)
3+
[![Maintenance](https://img.shields.io/maintenance/yes/2025)](https://pypi.org/project/qasync)
44
[![PyPI](https://img.shields.io/pypi/v/qasync)](https://pypi.org/project/qasync)
55
[![PyPI - License](https://img.shields.io/pypi/l/qasync)](/LICENSE)
66
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qasync)](https://pypi.org/project/qasync)
@@ -13,16 +13,18 @@
1313

1414
With `qasync`, you can use `asyncio` functionalities directly inside Qt app's event loop, in the main thread. Using async functions for Python tasks can be much easier and cleaner than using `threading.Thread` or `QThread`.
1515

16-
If you need some CPU-intensive tasks to be executed in parallel, `qasync` also got that covered, providing `QEventLoop.run_in_executor` which is functionally identical to that of `asyncio`.
16+
If you need some CPU-intensive tasks to be executed in parallel, `qasync` also got that covered, providing `QEventLoop.run_in_executor` which is functionally identical to that of `asyncio`. By default `QThreadExecutor` is used, but any class implementing the `concurrent.futures.Executor` interface will do the job.
1717

1818
### Basic Example
1919

2020
```python
21-
import sys
2221
import asyncio
22+
import sys
23+
24+
from PySide6.QtWidgets import QVBoxLayout, QWidget
25+
26+
from qasync import QApplication, QEventLoop
2327

24-
from qasync import QEventLoop, QApplication
25-
from PySide6.QtWidgets import QWidget, QVBoxLayout
2628

2729
class MainWindow(QWidget):
2830
def __init__(self):
@@ -67,7 +69,7 @@ More detailed examples can be found [here](https://github.com/CabbageDevelopment
6769

6870
## Requirements
6971

70-
- Python >= 3.8
72+
- Python >=3.8, <3.14
7173
- PyQt5/PyQt6 or PySide2/PySide6
7274

7375
`qasync` is tested on Ubuntu, Windows and MacOS.

examples/qml_httpx/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import asyncio
33
from pathlib import Path
44

5-
from qasync import QEventLoop, QApplication
65
from PySide6.QtCore import QUrl
76
from PySide6.QtQml import QQmlApplicationEngine, qmlRegisterType
7+
from qasync import QEventLoop, QApplication
88

99
from service import ExampleService
1010

examples/qml_httpx/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import httpx
22

3-
from qasync import asyncSlot
43
from PySide6.QtCore import QObject, Signal, Property, Slot
4+
from qasync import asyncSlot
55

66

77
class ExampleService(QObject):

0 commit comments

Comments
 (0)