Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 42 additions & 15 deletions .github/workflows/cibuildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
submodules: 'recursive'

Expand All @@ -48,6 +48,7 @@ jobs:
uses: turtlesec-no/get-ninja@main

- name: Install MSVC amd64
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
Expand All @@ -60,22 +61,22 @@ jobs:

- name: Build wheels (Windows)
if: runner.os == 'Windows'
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v3.2
env:
CIBW_BEFORE_ALL: python -m pip install cibuildwheel -U
CIBW_BUILD: 'cp310-win_amd64 cp311-win_amd64 cp312-win_amd64'
CIBW_BUILD: 'cp311-win_amd64 cp312-win_amd64 cp313-win_amd64'
CIBW_BEFORE_TEST: python -m pip install --upgrade pip && python -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
cmd /V /C "set BLOSC_TRACE=1 && python -m pytest {project}/tests"

- name: Build wheels (Linux x86_64)
if: ${{ matrix.os != 'windows-latest' && matrix.arch != 'aarch64' && runner.os == 'Linux'}}
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v3.2
env:
# The build requirements should be installed by the pyproject.toml specs
#CIBW_BEFORE_BUILD: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-build.txt
CIBW_ENVIRONMENT: CMAKE_OSX_ARCHITECTURES=x86_64
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_BUILD: 'cp311-* cp312-* cp313-*'
CIBW_BEFORE_TEST: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
BLOSC_TRACE=1 python3 -m pytest {project}/tests
Expand All @@ -84,12 +85,12 @@ jobs:

- name: Build wheels (Mac OSX x86_64)
if: ${{ matrix.os != 'windows-latest' && matrix.arch != 'aarch64' && runner.os != 'Linux' }}
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v3.2
env:
# The build requirements should be installed by the pyproject.toml specs
#CIBW_BEFORE_BUILD: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-build.txt
CIBW_ENVIRONMENT: CMAKE_OSX_ARCHITECTURES=x86_64 DONT_BUILD_EXAMPLES=1
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_BUILD: 'cp311-* cp312-* cp313-*'
CIBW_BEFORE_TEST: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
BLOSC_TRACE=1 python3 -m pytest {project}/tests
Expand All @@ -98,35 +99,61 @@ jobs:

- name: Build wheels (Ubuntu aarch64)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' }}
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v3.2
env:
# The build requirements should be installed by the pyproject.toml specs
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_BUILD: 'cp311-* cp312-* cp313-*'
CIBW_ARCHS_LINUX: "aarch64"

- name: Build wheels (Mac OSX arm64)
if: ${{ matrix.os != 'windows-latest' && runner.os != 'Linux' }}
uses: pypa/cibuildwheel@v2.16.5
if: ${{ matrix.os != 'windows-latest' && matrix.arch == 'arm64' && runner.os != 'Linux' }}
uses: pypa/cibuildwheel@v3.2
env:
# The build requirements should be installed by the pyproject.toml specs
CIBW_ENVIRONMENT: CMAKE_OSX_ARCHITECTURES=arm64
CIBW_BUILD: 'cp310-* cp311-* cp312-*'
CIBW_BUILD: 'cp311-* cp312-* cp313-*'
CIBW_TEST_SKIP: "*macosx*arm64*" # cibuild does not support testing arm64 on macos
CIBW_ARCHS_MACOS: "arm64"

- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

build_wasm_wheels:
name: Build WebAssembly wheels
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Build WebAssembly wheels
uses: pypa/cibuildwheel@v3.2
env:
CIBW_PLATFORM: pyodide
CIBW_BUILD: 'cp312-* cp313-*'
CIBW_BEFORE_BUILD: pip install blosc2
CIBW_TEST_SKIP: '*'

- name: Upload wasm wheels
uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

upload_pypi:
needs: [ build_wheels ] # last but not least
needs: [ build_wheels, build_wasm_wheels ]
runs-on: ubuntu-latest
# Only upload wheels when tagging (typically a release)
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v5
with:
name: artifact
path: dist
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,16 @@ else()
message(FATAL_ERROR "No Blosc2 includes found. Aborting.")
endif()

# Patch all CMake minimum version requirements in Grok and its dependencies
file(GLOB_RECURSE ALL_CMAKE_FILES
"src/grok/**/CMakeLists.txt"
"src/grok/**/*.cmake")
foreach(CMAKE_FILE ${ALL_CMAKE_FILES})
file(READ "${CMAKE_FILE}" FILE_CONTENT)
string(REGEX REPLACE "cmake_minimum_required\\(VERSION [0-9.]+\\)"
"cmake_minimum_required(VERSION 3.5...3.30)" FILE_CONTENT "${FILE_CONTENT}")
file(WRITE "${CMAKE_FILE}" "${FILE_CONTENT}")
endforeach()

include_directories("${BLOSC2_INCLUDE_DIR}")
add_subdirectory(src)
Loading