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

Draft: Add initial build wheels CI/CD pipeline #763

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ad3f0aa
Add initial build wheels CI/CD pipeline
dudoslav Aug 28, 2024
486a255
Fix working directory for cibuildwheels
dudoslav Aug 28, 2024
d206d82
Fix incorrect package-dir option
dudoslav Aug 28, 2024
d478e19
Disable all platforms except Ubuntu
dudoslav Aug 28, 2024
963f3bd
Install zlib1g-dev
dudoslav Aug 28, 2024
7c3c756
Fix install deps command
dudoslav Aug 28, 2024
85c4afd
Install xz as well
dudoslav Aug 28, 2024
26d7a6a
Use BEFORE_ALL instead of BEFORE_BUILD
dudoslav Aug 28, 2024
33e30fc
Update cibuildwheels version
dudoslav Aug 28, 2024
48ca0ee
Enable macos and windows wheels
dudoslav Aug 28, 2024
9183194
Install autoreconf for macos
dudoslav Aug 28, 2024
469bc6c
Add additional dependencies for macos build
dudoslav Aug 28, 2024
ba97a2b
Disable macos
dudoslav Aug 28, 2024
aeae6ad
Change mingw htslib hash
dudoslav Aug 30, 2024
47928e9
Quick rework CMake files
dudoslav Sep 3, 2024
b0988c7
Fix widnows build
Sep 9, 2024
1ded335
Fix install group
dudoslav Sep 9, 2024
572d827
Make tests optional
dudoslav Sep 9, 2024
59df672
Install tiledb.so
dudoslav Sep 9, 2024
34bb75d
Also install tiledbvcf
dudoslav Sep 9, 2024
ba57075
Test wheels
dudoslav Sep 12, 2024
019d843
Build with executables
dudoslav Sep 13, 2024
2ab078a
Fix macos workflow
dudoslav Sep 13, 2024
e15b381
Modify macos workflow
dudoslav Sep 13, 2024
be84c71
Change linking check paths
dudoslav Sep 13, 2024
9f36f87
Enable Macos wheel builds
dudoslav Sep 13, 2024
3c56c0d
Fix macos dependency install
dudoslav Sep 13, 2024
4634884
Install autoconf instead of autoreconf
dudoslav Sep 13, 2024
2b2f76d
Change macosx deployment version
dudoslav Sep 17, 2024
f72da21
Enable sdist and testing
dudoslav Sep 17, 2024
8929aca
Fix sdist
dudoslav Sep 17, 2024
131899f
Add pytest requires
dudoslav Sep 17, 2024
7d490e4
Add test extra dependency group
dudoslav Sep 17, 2024
e34397e
Install sdist test group
dudoslav Sep 17, 2024
13a982d
Add python code as well
dudoslav Sep 17, 2024
f5f5b6b
Install bcftools for tests
dudoslav Sep 17, 2024
3d077c5
Fix install bcftools
dudoslav Sep 17, 2024
5ed74f2
Install build dependencies for sdist tests
dudoslav Sep 17, 2024
1bdcb43
Return MACOSX_DEPLOYMENT_TARGET to 11
dudoslav Sep 17, 2024
5732183
MACOSX_DEPLOYMENT_TARGET to 13
dudoslav Sep 17, 2024
1318103
Temporarily comment out failing test
dudoslav Sep 18, 2024
f4afc69
Add install build dependencies to ci/cd
dudoslav Sep 18, 2024
fbd38d5
Fix missing dlls
Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 161 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Build and test wheels

on:
workflow_dispatch:
inputs:
version:
description: Version to use are release version
required: true
type: string
test_pypi:
description: Upload packages to test.pypi.org
required: false
type: boolean
default: false
push:
tags:
- "*"

env:
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_TILEDB: ${{ inputs.version }}

jobs:
build_wheels:
name: Wheel ${{ matrix.buildplat[0] }}-${{ matrix.buildplat[1] }}-${{ matrix.python }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
matrix:
buildplat:
- [ubuntu-22.04, manylinux_x86_64]
- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
- [windows-2022, win_amd64]
python: ["cp38", "cp39", "cp310", "cp311", "cp312"]

steps:
- uses: actions/checkout@v4

- name: "Brew setup on macOS" # x-ref c8e49ba8f8b9ce
if: ${{ startsWith(matrix.buildplat[0], 'macos-') == true }}
run: |
set -e pipefail
brew update
brew install automake pkg-config ninja llvm bzip2 xz autoconf zlib libdeflate bcftools

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_ENVIRONMENT_MACOS: >
CC=clang
CXX=clang++
CIBW_ARCHS: all
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_BEFORE_ALL_LINUX: yum install -y bzip2-devel xz-devel bcftools
CIBW_TEST_COMMAND: pytest {package}/apis/python
CIBW_TEST_EXTRAS: test
MACOSX_DEPLOYMENT_TARGET: "13.0"
with:
output-dir: wheelhouse

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.buildplat[0] }}-${{ matrix.buildplat[1] }}-${{ matrix.python }}
path: "./wheelhouse/*.whl"

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
outputs:
sdist_name: ${{ steps.get_sdist_name.outputs.sdist_name }}
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- name: Get sdist package name
id: get_sdist_name
run: |
echo "sdist_name=$(ls dist/ | head -n 1)" >> "$GITHUB_OUTPUT"

- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

test_sdist:
name: Test source distribution package
needs: [build_sdist]
strategy:
matrix:
os:
- macos-13
- macos-14
# - windows-2022 Currently we do not know how to install bcftools on windows
- ubuntu-22.04
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install bcftools MacOS
if: ${{ startsWith(matrix.os, 'macos-') == true }}
run: |
set -e pipefail
brew update
brew install automake pkg-config ninja llvm bzip2 xz autoconf zlib libdeflate bcftools

- name: Install bcftools Ubuntu
if: ${{ startsWith(matrix.os, 'ubuntu-') == true }}
run: sudo apt install bcftools

- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
name: sdist
path: dist

- name: Install sdist artifact
run: pip install --verbose dist/${{ needs.build_sdist.outputs.sdist_name }}[test]

- uses: actions/checkout@v4

- name: Run tests
shell: bash
run: |
PROJECT_CWD=$PWD
cd ..
pytest -vv --showlocals $PROJECT_CWD/apis/python

upload_pypi:
needs: [build_wheels, test_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
outputs:
package_version: ${{ steps.get_package_version.outputs.package_version }}
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

- id: get_package_version
run: |
echo "package_version=$(ls dist/ | head -n 1 | cut -d - -f 2)" >> "$GITHUB_OUTPUT"

- name: Upload to test-pypi
if: inputs.test_pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

# - name: Upload to pypi
# if: startsWith(github.ref, 'refs/tags/')
# uses: pypa/gh-action-pypi-publish@release/v1
24 changes: 11 additions & 13 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_INSTALL_PREFIX=$(pwd)/dist \
-D OVERRIDE_INSTALL_PREFIX=OFF \
-D DOWNLOAD_TILEDB_PREBUILT=ON
-D DOWNLOAD_TILEDB_PREBUILT=ON \
-D TILEDBVCF_ENABLE_TESTS=ON
- name: Build libtiledbvcf
run: cmake --build $(pwd)/libtiledbvcf/build -j 2 --config Debug
- name: Upload coredump as artifact if build failed
Expand Down Expand Up @@ -72,11 +73,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch everything for python setuptools_scm
- name: Download libtiledbvcf artifact
uses: actions/download-artifact@v4
with:
name: libtiledbvcf
path: dist
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -88,14 +84,16 @@ jobs:
create-args: tiledb
- name: Install dependencies
run: python -m pip install --prefer-binary pyarrow==10.0.1
- name: Intall build dependencies
run: |
set -e pipefail
brew update
brew install automake pkg-config ninja llvm bzip2 xz autoconf zlib libdeflate bcftools
- name: Build tiledbvcf-py
env:
LIBTILEDBVCF_PATH: "${{ github.workspace }}/dist"
TileDB_DIR: "/Users/runner/micromamba/envs/ci/lib/cmake/TileDB"
run: |
echo $DYLD_LIBRARY_PATH
echo $TileDB_DIR
cd apis/python
python -m pip install -v .[test]
- name: Confirm linking
run: otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.cpython-*-darwin.so
Expand Down Expand Up @@ -166,13 +164,13 @@ jobs:
- name: Install dependencies
run: python -m pip install --prefer-binary pyarrow==10.0.1
- name: Build tiledbvcf-py
run: cd apis/python && python -m pip install -v .[test]
run: python -m pip install -v .[test]
- name: Confirm linking
run: |
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.cpython-*-darwin.so
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledbvcf.dylib
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libtiledb.dylib
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/libhts.*.dylib
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/lib/libtiledbvcf.dylib
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/lib/libtiledb.dylib
otool -L /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tiledbvcf/lib/libhts.*.dylib
- name: Version
run: python -c "import tiledbvcf; print(tiledbvcf.version)"
- name: Install bcftools (for tests)
Expand Down
Loading
Loading