Skip to content

Commit

Permalink
Merge pull request #533 from nicoddemus/drop-py37-add-py312
Browse files Browse the repository at this point in the history
Drop Python 3.7 and add official 3.12 support
  • Loading branch information
nicoddemus authored Dec 22, 2023
2 parents d72ae76 + ea2cb69 commit 8c3bcce
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 46 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,38 @@ on:

jobs:

package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Check Package
uses: hynek/[email protected]

deploy:
needs: [package]

if: github.repository == 'pytest-dev/pytest-qt'

runs-on: ubuntu-latest

permissions:
id-token: write # For PyPI trusted publishers.
contents: write # For release.

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v3
- name: Download Package
uses: actions/download-artifact@v3
with:
python-version: "3.11"

- name: Build package
run: |
python -m pip install --upgrade pip
pip install build
python -m build
name: Packages
path: dist

- name: Publish package to PyPI
uses: pypa/[email protected]
uses: pypa/[email protected]

- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
body_path: scripts/latest-release-notes.md
files: dist/*
43 changes: 26 additions & 17 deletions .github/workflows/main.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: test

on: [push, pull_request]

Expand All @@ -8,42 +8,49 @@ concurrency:
cancel-in-progress: true

jobs:
build:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Check Package
uses: hynek/[email protected]

test:

needs: [package]

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
qt-lib: [pyqt5, pyqt6, pyside2, pyside6]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- python-version: "3.7"
tox-env: "py37"
- python-version: "3.8"
tox-env: "py38"
- python-version: "3.9"
tox-env: "py39"
- python-version: "3.10"
tox-env: "py310"
- python-version: "3.11"
tox-env: "py311"
exclude:
# Not installable:
# ERROR: Could not find a version that satisfies the requirement pyside2 (from versions: none)
- python-version: "3.11"
qt-lib: pyside2
os: windows-latest
- python-version: "3.12"
qt-lib: pyside2

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install tox
Expand All @@ -52,6 +59,8 @@ jobs:
sudo apt-get install -y libgles2-mesa-dev
fi
shell: bash
- name: Test with tox

- name: Test
shell: bash
run: |
tox -e ${{ matrix.tox-env }}-${{ matrix.qt-lib }} -- -ra --color=yes
tox -e py-${{ matrix.qt-lib }} --installpkg `find dist/*.tar.gz` -- -ra
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
UNRELEASED
-----------

- Added official support for Python 3.12.
- Python 3.7 is no longer supported.

- ``qapp`` now sets up the ``QApplication`` instance with a command line argument like this
``QApplication([prog_name])`` instead of using an empty list ``QApplication([])``.
Here ``prog_name`` is the name of the app which defaults to ``pytest-qt-app``, but can
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This allows you to test and make sure your view layer is behaving the way you ex
.. |conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/pytest-qt.svg
:target: https://anaconda.org/conda-forge/pytest-qt

.. |ci| image:: https://github.com/pytest-dev/pytest-qt/workflows/build/badge.svg
.. |ci| image:: https://github.com/pytest-dev/pytest-qt/workflows/test/badge.svg
:target: https://github.com/pytest-dev/pytest-qt/actions

.. |coverage| image:: http://img.shields.io/coveralls/pytest-dev/pytest-qt.svg
Expand Down
5 changes: 1 addition & 4 deletions setup.cfg → pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[bdist_wheel]
universal = 1

[tool:pytest]
[pytest]
testpaths = tests
addopts = --strict-markers --strict-config
xfail_strict = true
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@
author_email="[email protected]",
description="pytest support for PyQt and PySide applications",
long_description=Path("README.rst").read_text(encoding="UTF-8"),
long_description_content_type="text/x-rst",
license="MIT",
keywords="pytest qt test unittest",
url="http://github.com/pytest-dev/pytest-qt",
use_scm_version={"write_to": "src/pytestqt/_version.py"},
setup_requires=["setuptools_scm"],
python_requires=">=3.7",
python_requires=">=3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Desktop Environment :: Window Managers",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
Expand Down
3 changes: 3 additions & 0 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ def event(self, ev):


@exception_capture_pyside6
@pytest.mark.skipif(
sys.version_info[:2] == (3, 12), reason="#532 requires investigation"
)
def test_exceptions_dont_leak(testdir):
"""
Ensure exceptions are cleared when an exception occurs and don't leak (#187).
Expand Down
9 changes: 2 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{37,38,39,310}-{pyqt5,pyside2,pyside6,pyqt6}, linting
envlist = py{38,39,310,311,312}-{pyqt5,pyside2,pyside6,pyqt6}

[testenv]
deps=
Expand All @@ -9,7 +9,7 @@ deps=
pyqt5: pyqt5
pyqt6: pyqt6
commands=
pytest {posargs}
pytest --color=yes {posargs}
setenv=
pyside6: PYTEST_QT_API=pyside6
pyside2: PYTEST_QT_API=pyside2
Expand All @@ -22,11 +22,6 @@ passenv=
XAUTHORITY
COLUMNS

[testenv:linting]
skip_install = True
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure

[testenv:docs]
usedevelop = True
deps =
Expand Down

0 comments on commit 8c3bcce

Please sign in to comment.