Skip to content

Bump actions/setup-python from 4.0.0 to 5.3.0 #139

Bump actions/setup-python from 4.0.0 to 5.3.0

Bump actions/setup-python from 4.0.0 to 5.3.0 #139

Workflow file for this run

name: Packaging (chapter 7)
on:
- push
jobs:
format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5.3.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run black
run: tox -e format
working-directory: ch07/first-python-package # You don't need this in your package
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5.3.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run flake8
run: tox -e lint
working-directory: ch07/first-python-package # You don't need this in your package
typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5.3.0
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run mypy
run: python -m tox -e typecheck
working-directory: ch07/first-python-package # You don't need this in your package
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python:
- version: "3.10"
toxenv: "py310"
- version: "3.9"
toxenv: "py39"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5.3.0
with:
python-version: ${{ matrix.python.version }}
- name: Install tox
run: python -m pip install tox
- name: Run pytest
run: tox -e ${{ matrix.python.toxenv }}
working-directory: ch07/first-python-package # You don't need this in your package
build_source_dist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5.3.0
with:
python-version: "3.10"
- name: Install build
run: python -m pip install build
- name: Run build
run: python -m build --sdist
working-directory: ch07/first-python-package # You don't need this in your package
- uses: actions/upload-artifact@v3
with:
path: ch07/first-python-package/dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-10.15]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5.3.0
with:
python-version: "3.10"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.3.1
- name: Build wheels
run: python -m cibuildwheel --output-dir wheels
working-directory: ch07/first-python-package # You don't need this in your package
- uses: actions/upload-artifact@v3
with:
path: ./ch07/first-python-package/wheels/*.whl # Update to match root of package
publish:
name: Publish package
if: startsWith(github.event.ref, 'refs/tags/v')
needs:
- format
- lint
- typecheck
- test
- build_source_dist
- build_wheels
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: ./ch07/first-python-package/dist # Update to match root of package
- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: ./ch07/first-python-package/dist/ # You don't need this in your package