Skip to content

update pre-commit and ruff configurations #3201

update pre-commit and ruff configurations

update pre-commit and ruff configurations #3201

Workflow file for this run

name: Build and upload to PyPI
on:
push:
branches:
- master
tags:
- v*
pull_request:
jobs:
build_wheels:
name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# linux-64
- os: ubuntu-latest
python: 37
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 38
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 39
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 310
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 311
platform_id: manylinux_x86_64
# macos-x86-64
- os: macos-latest
python: 37
platform_id: macosx_x86_64
- os: macos-latest
python: 38
platform_id: macosx_universal2
- os: macos-latest
python: 39
platform_id: macosx_universal2
- os: macos-latest
python: 310
platform_id: macosx_universal2
- os: macos-latest
python: 311
platform_id: macosx_universal2
# win-64
- os: windows-2019
python: 37
platform_id: win_amd64
- os: windows-2019
python: 38
platform_id: win_amd64
- os: windows-2019
python: 39
platform_id: win_amd64
- os: windows-2019
python: 310
platform_id: win_amd64
- os: windows-2019
python: 311
platform_id: win_amd64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.11.1
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: all
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- run: python -m pip install build
- name: Build sdist
run: python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1