Skip to content

Commit

Permalink
Merge pull request #10729 from nicoddemus/backport-10722
Browse files Browse the repository at this point in the history
[7.2.x] Use build-and-inspect-python-package action (#10722)
  • Loading branch information
nicoddemus committed Feb 14, 2023
2 parents 02e9e84 + 1e83bd8 commit 0aeb843
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/deploy.yml
Expand Up @@ -28,25 +28,30 @@ jobs:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build tox
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5

- name: Build package
run: |
python -m build
- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"

- name: Install tox
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
- name: Publish GitHub release notes
env:
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -18,6 +18,11 @@ on:
env:
PYTEST_ADDOPTS: "--color=yes"

# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Set permissions at the job level.
permissions: {}

Expand Down Expand Up @@ -189,3 +194,10 @@ jobs:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true

check-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5
5 changes: 5 additions & 0 deletions pyproject.toml
Expand Up @@ -114,3 +114,8 @@ template = "changelog/_template.rst"

[tool.black]
target-version = ['py37']

# check-wheel-contents is executed by the build-and-inspect-python-package action.
[tool.check-wheel-contents]
# W009: Wheel contains multiple toplevel library entries
ignore = "W009"

0 comments on commit 0aeb843

Please sign in to comment.