From e8653d04cdc868a94f751286e7a75dac31de2a0e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 4 Oct 2023 19:13:13 -0300 Subject: [PATCH 1/4] New AsyncTester.timeout_s to control the timeout for start_and_wait() --- CHANGELOG.rst | 6 ++++++ src/qt_async_threads/pytest_plugin.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d677988..9d1ddbb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,9 @@ +0.5.0 +----- + +- New attribute ``AsyncTester.timeout_s``, with the timeout in seconds until ``start_and_wait`` + raises ``TimeoutError``. + 0.4.0 ----- diff --git a/src/qt_async_threads/pytest_plugin.py b/src/qt_async_threads/pytest_plugin.py index 038ecf3..3e41975 100644 --- a/src/qt_async_threads/pytest_plugin.py +++ b/src/qt_async_threads/pytest_plugin.py @@ -36,12 +36,15 @@ class AsyncTester: runner: QtAsyncRunner qtbot: QtBot + #: Timeout in seconds for ``QtBot.waitUntil`` during ``start_and_wait``. + timeout_s: int = 5 + def _get_wait_idle_timeout(self) -> int: """ Return the maximum amount of time we should wait for the runner to become idle, in ms. """ - timeout_s = 5 # This is the default timeout from pytest-qt. + timeout_s = self.timeout_s in_ci = os.environ.get("CI") == "true" in_debugger = sys.gettrace() is not None if in_debugger and not in_ci: From 46c3b7cc029e6eb086ad8ae4542bfee1865de19d Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 4 Oct 2023 19:19:47 -0300 Subject: [PATCH 2/4] Improve CI: use trusted publisher, GitHub release --- .github/workflows/deploy.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 14ae031..2adc400 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,19 +12,25 @@ jobs: steps: - uses: actions/checkout@v1 + - name: Set up Python uses: actions/setup-python@v1 with: python-version: "3.10" + - name: Install dependencies run: | python -m pip install --upgrade pip pip install build + - name: Build package run: | python -m build + - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@master + + - name: GitHub Release + uses: softprops/action-gh-release@v1 with: - user: __token__ - password: ${{ secrets.pypi_token }} + files: dist/* From bf0cedfe2f57b833e9591d5ed3b43854773ab708 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 4 Oct 2023 19:23:27 -0300 Subject: [PATCH 3/4] Use pypa/gh-action-pypi-publish@v1.8.5 --- .github/workflows/deploy.yml | 2 +- CHANGELOG.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2adc400..43e1134 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: python -m build - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@v1.8.5 - name: GitHub Release uses: softprops/action-gh-release@v1 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9d1ddbb..e8eed35 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,4 +1,4 @@ -0.5.0 +0.5.1 ----- - New attribute ``AsyncTester.timeout_s``, with the timeout in seconds until ``start_and_wait`` From c386b485db8adf019fe48d2b74a059c12779ea7d Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 4 Oct 2023 19:25:30 -0300 Subject: [PATCH 4/4] Fix deploy permissions --- .github/workflows/deploy.yml | 3 +++ CHANGELOG.rst | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 43e1134..e688e7e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,9 @@ jobs: deploy: runs-on: ubuntu-latest + permissions: + id-token: write # For PyPI trusted publishers. + contents: write # For release notes. steps: - uses: actions/checkout@v1 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e8eed35..c531e46 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,4 +1,4 @@ -0.5.1 +0.5.2 ----- - New attribute ``AsyncTester.timeout_s``, with the timeout in seconds until ``start_and_wait``