Skip to content

Commit 1e83bd8

Browse files
nicoddemuspytestbot
authored andcommitted
Use build-and-inspect-python-package action (#10722)
This uses https://github.com/hynek/build-and-inspect-python-package to ensure our package is correct, both during testing and deploy,
1 parent 02e9e84 commit 1e83bd8

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

.github/workflows/deploy.yml

+17-12
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,30 @@ jobs:
2828
fetch-depth: 0
2929
persist-credentials: false
3030

31-
- name: Set up Python
32-
uses: actions/setup-python@v2
33-
with:
34-
python-version: "3.7"
35-
36-
- name: Install dependencies
37-
run: |
38-
python -m pip install --upgrade pip
39-
pip install --upgrade build tox
31+
- name: Build and Check Package
32+
uses: hynek/[email protected]
4033

41-
- name: Build package
42-
run: |
43-
python -m build
34+
- name: Download Package
35+
uses: actions/download-artifact@v3
36+
with:
37+
name: Packages
38+
path: dist
4439

4540
- name: Publish package to PyPI
4641
uses: pypa/gh-action-pypi-publish@release/v1
4742
with:
4843
password: ${{ secrets.pypi_token }}
4944

45+
- name: Set up Python
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: "3.7"
49+
50+
- name: Install tox
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install --upgrade tox
54+
5055
- name: Publish GitHub release notes
5156
env:
5257
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}

.github/workflows/test.yml

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
env:
1919
PYTEST_ADDOPTS: "--color=yes"
2020

21+
# Cancel running jobs for the same workflow and branch.
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
2126
# Set permissions at the job level.
2227
permissions: {}
2328

@@ -189,3 +194,10 @@ jobs:
189194
fail_ci_if_error: true
190195
files: ./coverage.xml
191196
verbose: true
197+
198+
check-package:
199+
runs-on: ubuntu-latest
200+
steps:
201+
- uses: actions/checkout@v3
202+
- name: Build and Check Package
203+
uses: hynek/[email protected]

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,8 @@ template = "changelog/_template.rst"
114114

115115
[tool.black]
116116
target-version = ['py37']
117+
118+
# check-wheel-contents is executed by the build-and-inspect-python-package action.
119+
[tool.check-wheel-contents]
120+
# W009: Wheel contains multiple toplevel library entries
121+
ignore = "W009"

0 commit comments

Comments
 (0)