Skip to content

Commit 822e94e

Browse files
committed
ci overhaul
1 parent 52c61bd commit 822e94e

File tree

5 files changed

+102
-77
lines changed

5 files changed

+102
-77
lines changed

.github/workflows/publish.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
build:
1010
name: Build and upload release to PyPi
1111
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/iblqt
1215
permissions:
1316
id-token: write
1417
steps:

.github/workflows/testing.yaml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,17 @@ on:
1010
- 'v[0-9]+.[0-9]+.[0-9]+'
1111

1212
jobs:
13-
Ruff:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
- uses: astral-sh/ruff-action@v3
18-
with:
19-
version-file: 'pyproject.toml'
20-
args: 'check --output-format=github'
21-
- run: 'ruff format --check --diff'
22-
23-
Testing:
13+
tox:
2414
needs: [Ruff]
2515
runs-on: ${{ matrix.os }}
2616
strategy:
2717
matrix:
2818
os: [ubuntu-latest, macos-latest, windows-latest]
2919
steps:
3020
- uses: actions/checkout@v4
31-
- name: Install uv
32-
uses: astral-sh/setup-uv@v6
21+
- uses: astral-sh/setup-uv@v6
3322
- name: Install dependencies
34-
run: uv sync --no-default-groups --group test --group ci --group typing
23+
run: uv sync --no-default-groups --group test --group ci
3524
- name: Install libegl1 (Ubuntu only)
3625
if: matrix.os == 'ubuntu-latest'
3726
uses: awalsh128/cache-apt-pkgs-action@latest
@@ -41,7 +30,12 @@ jobs:
4130
- name: Run Tests
4231
env:
4332
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
PLATFORM: ${{ matrix.os }}
45-
EXTRA_DEPS: ci
46-
POST_COMMAND: '- coveralls --submit=${{ env.COVERAGE_FILE }}'
47-
run: uv run tox -p auto --parallel-no-spinner
33+
run: uv run tox --parallel-no-spinner
34+
finish:
35+
needs: tox
36+
if: ${{ always() }}
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: coverallsapp/github-action@v2
40+
with:
41+
parallel-finished: true

pyproject.toml

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ lint = [
6060
"ruff>=0.9.2",
6161
]
6262
test = [
63+
{include-group = "typing"},
64+
{include-group = "lint"},
6365
"pytest>=8.3.4",
6466
"pytest-cov>=6.0.0",
6567
"pytest-qt>=4.4.0",
@@ -132,62 +134,3 @@ source = [
132134
".tox/py*/lib/py*/site-packages/iblqt/",
133135
".tox/py*/Lib/site-packages/iblqt/"
134136
]
135-
136-
[tool.tox]
137-
legacy_tox_ini = """
138-
[tox]
139-
env_list = clean,typing,py{310,313}-{pyqt5,pyqt6,pyside6},report
140-
141-
[testenv]
142-
dependency_groups = test
143-
runner = uv-venv-lock-runner
144-
145-
[testenv:py{310,313}-{pyqt5,pyqt6,pyside6}]
146-
depends = clean
147-
commands =
148-
pytest
149-
{env:POST_COMMAND:python --version}
150-
dependency_groups =
151-
test
152-
{env:EXTRA_DEPS:}
153-
extras=
154-
pyqt5: pyqt5
155-
pyqt6: pyqt6
156-
pyside6: pyside6
157-
setenv =
158-
py310: PYTHON=py310
159-
py313: PYTHON=py313
160-
pyqt5: PYTEST_QT_API=pyqt5
161-
pyqt6: PYTEST_QT_API=pyqt6
162-
pyside6: PYTEST_QT_API=pyside6
163-
COVERALLS_FLAG_NAME={env:PLATFORM}_{env:PYTHON}_{env:PYTEST_QT_API}
164-
COVERAGE_FILE=.coverage.{env:PYTHON}.{env:PYTEST_QT_API}.xml
165-
QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu"
166-
QT_QPA_PLATFORM=offscreen
167-
QT_QUICK_BACKEND=software
168-
QT_OPENGL=software
169-
TOX=true
170-
passenv=
171-
DISPLAY
172-
XAUTHORITY
173-
COLUMNS
174-
GITHUB_*
175-
EXTRA_DEPS
176-
177-
[testenv:clean]
178-
skip_install = true
179-
commands =
180-
coverage erase
181-
182-
[testenv:typing]
183-
skip_install = true
184-
dependency_groups = typing
185-
extras = pyqt5
186-
commands = mypy --always-true=PYQT5 --always-false=PYQT6 --always-false=PYSIDE6
187-
188-
[testenv:report]
189-
depends = py{310,313}-{pyqt5,pyqt6,pyside6}
190-
skip_install = true
191-
commands =
192-
coverage combine
193-
"""

tox.ini

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[tox]
2+
requires = tox >= 4.25.0
3+
env_list = ruff{posargs},clean,typing,py{310,313}-{pyqt5,pyqt6,pyside6}{posargs},report
4+
5+
[testenv]
6+
dependency_groups = test
7+
runner = uv-venv-lock-runner
8+
setenv =
9+
pyqt5: PYTEST_QT_API=pyqt5
10+
pyqt6: PYTEST_QT_API=pyqt6
11+
pyside6: PYTEST_QT_API=pyside6
12+
COVERAGE_FILE = .coverage.{py_dot_ver}.{env:PYTEST_QT_API}
13+
QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu"
14+
QT_QPA_PLATFORM=offscreen
15+
QT_QUICK_BACKEND=software
16+
QT_OPENGL=software
17+
18+
[testenv:ruff{,-ci}]
19+
description = run ruff linter
20+
dependency_groups = lint
21+
commands =
22+
ruff: ruff check
23+
ruff-ci: ruff check --output-format=github
24+
ruff format --check
25+
skip_install = true
26+
27+
[testenv:typing]
28+
description = run mypy type checker
29+
dependency_groups = typing
30+
commands = mypy
31+
skip_install = true
32+
33+
[testenv:clean]
34+
description = clean up coverage files
35+
commands = coverage erase
36+
skip_install = true
37+
38+
[testenv:py31{0,3}-{pyqt5,pyqt6,pyside6}]
39+
description = run pytest on python {py_dot_ver}
40+
depends = clean
41+
commands = pytest
42+
extras=
43+
pyqt5: pyqt5
44+
pyqt6: pyqt6
45+
pyside6: pyside6
46+
47+
[testenv:py31{0,3}-{pyqt5,pyqt6,pyside6}-ci]
48+
description = run pytest on python {py_dot_ver}
49+
depends = clean
50+
dependency_groups =
51+
{[testenv]dependency_groups}
52+
ci
53+
extras=
54+
pyqt5: pyqt5
55+
pyqt6: pyqt6
56+
pyside6: pyside6
57+
commands =
58+
pytest
59+
coveralls
60+
setenv =
61+
{[testenv]setenv}
62+
COVERALLS_FLAG_NAME = {on_platform}_python{py_dot_ver}_{env:PYTEST_QT_API}
63+
COVERALLS_PARALLEL = true
64+
passenv =
65+
DISPLAY
66+
XAUTHORITY
67+
COLUMNS
68+
GITHUB_*
69+
70+
[testenv:report]
71+
description = combine coverage files
72+
depends = py{310,313}-{pyqt5,pyqt6,pyside6}{posargs}
73+
setenv = COVERAGE_FILE = .coverage
74+
commands = coverage combine
75+
skip_install = true

uv.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)