Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use cibuildwheel to build linux wheels #2800

Merged
merged 12 commits into from Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 40 additions & 12 deletions .github/workflows/test.yml
Expand Up @@ -124,28 +124,56 @@ jobs:
continue-on-error: true
uses: AndreMiras/coveralls-python-action@v20201129

release:
build_sdist:
needs: pytest
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

build_wheels:
needs: pytest
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.task == 'release')
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['38', '39', '310', '311']
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.4
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

release:
needs: [build_wheels, build_sdist]
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.task == 'release')
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
python-version: 3.11
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Release
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python -m pip install --upgrade pip twine build
python -m build
python -m twine upload --skip-existing dist/*.whl dist/*.tar.gz
pipx run twine upload --skip-existing dist/*.whl dist/*.tar.gz
8 changes: 8 additions & 0 deletions pyproject.toml
Expand Up @@ -10,6 +10,14 @@ build-backend = "setuptools.build_meta"
[tool.black]
line-length = 120

[tool.cibuildwheel.linux]
archs = ["auto64"]
skip = ["*musllinux*"]
before-all = "ln -s /usr/lib64/libgfortran.so.5 /usr/lib64/libgfortran.so.3"

[tool.cibuildwheel.macos]
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --ignore-missing-dependencies"

[tool.ruff]
target-version = "py38"
line-length = 120
Expand Down