Skip to content

Commit 8c3bcce

Browse files
authored
Merge pull request #533 from nicoddemus/drop-py37-add-py312
Drop Python 3.7 and add official 3.12 support
2 parents d72ae76 + ea2cb69 commit 8c3bcce

File tree

8 files changed

+63
-46
lines changed

8 files changed

+63
-46
lines changed

.github/workflows/deploy.yml

+23-15
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,38 @@ on:
77

88
jobs:
99

10+
package:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Build and Check Package
15+
uses: hynek/[email protected]
16+
1017
deploy:
18+
needs: [package]
19+
1120
if: github.repository == 'pytest-dev/pytest-qt'
1221

1322
runs-on: ubuntu-latest
1423

24+
permissions:
25+
id-token: write # For PyPI trusted publishers.
26+
contents: write # For release.
27+
1528
steps:
1629
- uses: actions/checkout@v3
17-
with:
18-
fetch-depth: 0
19-
persist-credentials: false
2030

21-
- name: Set up Python
22-
uses: actions/setup-python@v3
31+
- name: Download Package
32+
uses: actions/download-artifact@v3
2333
with:
24-
python-version: "3.11"
25-
26-
- name: Build package
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install build
30-
python -m build
34+
name: Packages
35+
path: dist
3136

3237
- name: Publish package to PyPI
33-
uses: pypa/[email protected]
38+
uses: pypa/[email protected]
39+
40+
- name: GitHub Release
41+
uses: softprops/action-gh-release@v1
3442
with:
35-
user: __token__
36-
password: ${{ secrets.pypi_token }}
43+
body_path: scripts/latest-release-notes.md
44+
files: dist/*
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build
1+
name: test
22

33
on: [push, pull_request]
44

@@ -8,42 +8,49 @@ concurrency:
88
cancel-in-progress: true
99

1010
jobs:
11-
build:
11+
package:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Build and Check Package
16+
uses: hynek/[email protected]
17+
18+
test:
19+
20+
needs: [package]
1221

1322
runs-on: ${{ matrix.os }}
1423
strategy:
1524
fail-fast: false
1625

1726
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
27+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1928
qt-lib: [pyqt5, pyqt6, pyside2, pyside6]
2029
os: [ubuntu-latest, windows-latest, macos-latest]
21-
include:
22-
- python-version: "3.7"
23-
tox-env: "py37"
24-
- python-version: "3.8"
25-
tox-env: "py38"
26-
- python-version: "3.9"
27-
tox-env: "py39"
28-
- python-version: "3.10"
29-
tox-env: "py310"
30-
- python-version: "3.11"
31-
tox-env: "py311"
3230
exclude:
3331
# Not installable:
3432
# ERROR: Could not find a version that satisfies the requirement pyside2 (from versions: none)
3533
- python-version: "3.11"
3634
qt-lib: pyside2
3735
os: windows-latest
36+
- python-version: "3.12"
37+
qt-lib: pyside2
3838

3939
steps:
4040
- uses: actions/checkout@v3
41+
4142
- name: Set up Python ${{ matrix.python-version }}
4243
uses: actions/setup-python@v3
4344
with:
4445
python-version: ${{ matrix.python-version }}
4546

46-
- name: Install dependencies
47+
- name: Download Package
48+
uses: actions/download-artifact@v3
49+
with:
50+
name: Packages
51+
path: dist
52+
53+
- name: Install Dependencies
4754
run: |
4855
python -m pip install --upgrade pip
4956
pip install tox
@@ -52,6 +59,8 @@ jobs:
5259
sudo apt-get install -y libgles2-mesa-dev
5360
fi
5461
shell: bash
55-
- name: Test with tox
62+
63+
- name: Test
64+
shell: bash
5665
run: |
57-
tox -e ${{ matrix.tox-env }}-${{ matrix.qt-lib }} -- -ra --color=yes
66+
tox -e py-${{ matrix.qt-lib }} --installpkg `find dist/*.tar.gz` -- -ra

CHANGELOG.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
UNRELEASED
22
-----------
33

4+
- Added official support for Python 3.12.
5+
- Python 3.7 is no longer supported.
6+
47
- ``qapp`` now sets up the ``QApplication`` instance with a command line argument like this
58
``QApplication([prog_name])`` instead of using an empty list ``QApplication([])``.
69
Here ``prog_name`` is the name of the app which defaults to ``pytest-qt-app``, but can

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This allows you to test and make sure your view layer is behaving the way you ex
3636
.. |conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/pytest-qt.svg
3737
:target: https://anaconda.org/conda-forge/pytest-qt
3838

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

4242
.. |coverage| image:: http://img.shields.io/coveralls/pytest-dev/pytest-qt.svg

setup.cfg renamed to pytest.ini

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
[bdist_wheel]
2-
universal = 1
3-
4-
[tool:pytest]
1+
[pytest]
52
testpaths = tests
63
addopts = --strict-markers --strict-config
74
xfail_strict = true

setup.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,25 @@
1818
author_email="[email protected]",
1919
description="pytest support for PyQt and PySide applications",
2020
long_description=Path("README.rst").read_text(encoding="UTF-8"),
21+
long_description_content_type="text/x-rst",
2122
license="MIT",
2223
keywords="pytest qt test unittest",
2324
url="http://github.com/pytest-dev/pytest-qt",
2425
use_scm_version={"write_to": "src/pytestqt/_version.py"},
2526
setup_requires=["setuptools_scm"],
26-
python_requires=">=3.7",
27+
python_requires=">=3.8",
2728
classifiers=[
2829
"Development Status :: 5 - Production/Stable",
2930
"Framework :: Pytest",
3031
"Intended Audience :: Developers",
3132
"License :: OSI Approved :: MIT License",
3233
"Operating System :: OS Independent",
3334
"Programming Language :: Python :: 3",
34-
"Programming Language :: Python :: 3.7",
3535
"Programming Language :: Python :: 3.8",
3636
"Programming Language :: Python :: 3.9",
3737
"Programming Language :: Python :: 3.10",
38+
"Programming Language :: Python :: 3.11",
39+
"Programming Language :: Python :: 3.12",
3840
"Topic :: Desktop Environment :: Window Managers",
3941
"Topic :: Software Development :: Quality Assurance",
4042
"Topic :: Software Development :: Testing",

tests/test_exceptions.py

+3
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ def event(self, ev):
365365

366366

367367
@exception_capture_pyside6
368+
@pytest.mark.skipif(
369+
sys.version_info[:2] == (3, 12), reason="#532 requires investigation"
370+
)
368371
def test_exceptions_dont_leak(testdir):
369372
"""
370373
Ensure exceptions are cleared when an exception occurs and don't leak (#187).

tox.ini

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{37,38,39,310}-{pyqt5,pyside2,pyside6,pyqt6}, linting
2+
envlist = py{38,39,310,311,312}-{pyqt5,pyside2,pyside6,pyqt6}
33

44
[testenv]
55
deps=
@@ -9,7 +9,7 @@ deps=
99
pyqt5: pyqt5
1010
pyqt6: pyqt6
1111
commands=
12-
pytest {posargs}
12+
pytest --color=yes {posargs}
1313
setenv=
1414
pyside6: PYTEST_QT_API=pyside6
1515
pyside2: PYTEST_QT_API=pyside2
@@ -22,11 +22,6 @@ passenv=
2222
XAUTHORITY
2323
COLUMNS
2424

25-
[testenv:linting]
26-
skip_install = True
27-
deps = pre-commit
28-
commands = pre-commit run --all-files --show-diff-on-failure
29-
3025
[testenv:docs]
3126
usedevelop = True
3227
deps =

0 commit comments

Comments
 (0)