Skip to content

Build wheels

Build wheels #2

name: Build wheels
on: [workflow_dispatch]
jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
submodules: true # Optional, use if you have submodules
- name: Install dependencies
run: python -m pip install cython numpy pysam
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest]
#, windows-latest, macos-13, macos-14]
python-version: [ "3.11" ] # "3.7", "3.8", "3.9", "3.10",
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# - name: Build wheels
# uses: pypa/[email protected]
# # uses: pypa/[email protected]
# # env:
# # CIBW_SOME_OPTION: value
# # ...
# # with:
# # package-dir: .
# # output-dir: wheelhouse
# # config-file: "{package}/pyproject.toml"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
# to supply options, put them in 'env', like:
env:
#CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
CIBW_BUILD_FRONTEND: "build; args: --no-isolation"
CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel -y;"
# we have to recompile pysam so that repairwheel can later find various libraries (libssl, libnghttp2, etc)
#CIBW_BEFORE_ALL: "yum install bzip2-devel xz-devel openssl-devel openldap-devel krb5-devel libssh-devel libnghttp2-devel -y;"
CIBW_BEFORE_BUILD: "python -m pip install setuptools cython numpy pysam --no-binary pysam"
# skip building 32-bit wheels (i686)
CIBW_ARCHS_LINUX: "auto64"
# we could use 2_28 to download pysam's wheel instead of compiling it ;
# HOWEVER THAT DIDN'T WORK BECAUSE PYSAM DEPENDS ON LIBSSL, LIBNGHTTP2, ETC, WHICH CANNOT BE FOUND
# SO WE ARE BACK TO COMPILING PYSAM'S WHEEL (no-binary pysam)
# CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28"
## skip building pypy and musllinux
CIBW_SKIP: pp* *musllinux*
#CIBW_REPAIR_WHEEL_COMMAND: 'auditwheel -v repair -w {dest_dir} {wheel}'
#PIP_NO_CACHE_DIR: "false"
#PIP_NO_BUILD_ISOLATION: "false"
#PIP_NO_BINARY: "pysam"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./dist/*.whl