Skip to content

Commit

Permalink
Merge pull request #1 from larsoner/cmake
Browse files Browse the repository at this point in the history
BUG: Fix bug with req for manylinux image
  • Loading branch information
Mathieu Scheltienne authored Aug 14, 2024
2 parents 102bb00 + 9a3665f commit e2b3155
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 165 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/build.yaml

This file was deleted.

147 changes: 147 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'
release:
types: [published]

jobs:
cibuildwheel:
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
name: build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.20.0
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-native
path: ./wheelhouse/*.whl

cibuildwheel_emulated_cross: # separate out because it's slower and not tested separately
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: aarch64
- os: windows-latest
arch: ARM64
name: build wheels on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup emulation on Linux
uses: docker/setup-qemu-action@v3
with:
platforms: all
if: runner.os == 'Linux'
- uses: pypa/cibuildwheel@v2.20.0
env:
CIBW_ARCHS: ${{ matrix.arch }}
# https://cibuildwheel.pypa.io/en/stable/faq/#windows-arm64
CIBW_TEST_SKIP: "*-win_arm64"
CIBW_BEFORE_BUILD_WINDOWS: bash ./.github/workflows/cibw_before_build_windows_cross.sh
CIBW_BUILD_VERBOSITY: 3
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

test:
needs: cibuildwheel
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
python: ["3.9", "3.12"]
name: test wheels on ${{ matrix.os }} ${{ matrix.python }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheels-*
merge-multiple: true
path: dist
- run: ls -alt . && ls -alt dist/
- run: pip install --only-binary antio antio[test] --find-links dist
- run: pytest tests/ --cov=antio --cov-report=xml
- uses: codecov/codecov-action@v4

sdist:
timeout-minutes: 10
name: create sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install --upgrade build
- run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-sdist
path: ./dist/*.tar.gz

check:
needs: [cibuildwheel, cibuildwheel_emulated_cross, sdist]
timeout-minutes: 10
name: check dist/*
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheels-*
merge-multiple: true
path: dist
- run: ls -alt . && ls -alt dist/
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install --upgrade twine
- run: twine check --strict dist/*

publish:
needs: [check, test]
name: publish PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/antio
timeout-minutes: 10
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-wheels-*
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
9 changes: 9 additions & 0 deletions .github/workflows/cibw_before_build_windows_cross.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -eo pipefail

pip install delvewheel
echo "CMAKE_GENERATOR=Visual Studio 17 2022" | tee -a $GITHUB_ENV
echo "CMAKE_GENERATOR_PLATFORM=$CIBW_ARCHS" | tee -a $GITHUB_ENV
PY_VER=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:3])))")
Python3_SABI_LIBRARY="C:\\Users\\runneradmin\\AppData\\Local\\pypa\\cibuildwheel\\Cache\\nuget-cpython\\python${CIBW_ARCHS,,}.${PY_VER}\\tools\\libs\\python3.lib"
echo "Python3_SABI_LIBRARY=$Python3_SABI_LIBRARY" | tee -a $GITHUB_ENV
32 changes: 0 additions & 32 deletions .github/workflows/publish.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/unittests.yaml

This file was deleted.

25 changes: 21 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ all = [
]
build = [
'build',
'cibuildwheel[uv]',
'cibuildwheel',
'setuptools>= 64.0.0',
'twine',
]
Expand Down Expand Up @@ -83,12 +83,29 @@ source = 'https://github.com/mscheltienne/antio'
tracker = 'https://github.com/mscheltienne/antio/issues'

[tool.cibuildwheel]
build-frontend = "build[uv]"
test-command = "pytest tests --cov=src/antio --cov-report=xml --cov-config=pyproject.toml"
build = "cp312-*"
skip = "*musllinux*"
archs = "native"
test-command = "pytest {project}/tests"
test-extras = ["mne", "test"]

[tool.cibuildwheel.linux]
before-all = "sudo yum update -y & sudo yum install https://repo.ius.io/ius-release-el$(rpm -E '%{rhel}').rpm & sudo yum update -y & yum install -y python3-devel"
repair-wheel-command = [
"auditwheel repair -w {dest_dir} {wheel}",
"pipx run abi3audit --strict --report {wheel}",
]
[tool.cibuildwheel.macos]
repair-wheel-command = [
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}",
"pipx run abi3audit --strict --report {wheel}",
]

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
repair-wheel-command = [
"delvewheel repair -w {dest_dir} {wheel}",
"pipx run abi3audit --strict --report {wheel}",
]

[tool.codespell]
check-filenames = true
Expand Down
Loading

0 comments on commit e2b3155

Please sign in to comment.