Skip to content

Commit 6956267

Browse files
committed
build: Move building and checking of distribution files into dedicated tox environment.
This simplifies the GitHub Actions workflow, allows future pinning of the dependencies associated with the check, and aligns development and CI setups more closely.
1 parent 3691c03 commit 6956267

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,12 @@ jobs:
3737
run: python -m pip install pre-commit
3838
- name: Run pre-commit checks
3939
run: pre-commit run --all-files --show-diff-on-failure
40-
- name: Install check-wheel-content, and twine
41-
run: python -m pip install build check-wheel-contents twine
42-
- name: Build package
43-
run: python -m build
40+
- name: Install tox
41+
run: python -m pip install tox
42+
- name: Build package and check distributions
43+
run: tox run -e build
4444
- name: List result
4545
run: ls -l dist
46-
- name: Check wheel contents
47-
run: check-wheel-contents dist/*.whl
48-
- name: Check long_description
49-
run: python -m twine check dist/*
5046
- name: Install pytest-asyncio
5147
run: pip install .
5248
- name: Get version info

tox.ini

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
minversion = 4.28.0
3-
envlist = py39, py310, py311, py312, py313, py314, pytest-min, docs, pyright
3+
envlist = build, py39, py310, py311, py312, py313, py314, pytest-min, docs, pyright
44
isolated_build = true
55
passenv =
66
CI
@@ -23,6 +23,15 @@ commands =
2323
python -c 'import shutil; shutil.rmtree("{toxinidir}{/}dist", ignore_errors=True)'
2424
pyproject-build --outdir {toxinidir}{/}dist .
2525

26+
[testenv:build]
27+
description = Check distribution files
28+
deps =
29+
check-wheel-contents
30+
twine
31+
commands =
32+
check-wheel-contents {toxinidir}{/}dist
33+
twine check {toxinidir}{/}dist{/}*
34+
2635
[testenv:pytest-min]
2736
extras = testing
2837
constraints = dependencies/pytest-min/constraints.txt
@@ -81,7 +90,7 @@ skip_install = true
8190

8291
[gh-actions]
8392
python =
84-
3.9: py39, pytest-min
93+
3.9: py39, pytest-min, build
8594
3.10: py310
8695
3.11: py311
8796
3.12: py312

0 commit comments

Comments
 (0)