Skip to content

Commit

Permalink
Use python3 in CI && only build as shared lib for Mac arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
martaiborra committed Apr 3, 2024
1 parent 4ff678b commit abd95de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cibuildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ jobs:
if: runner.os == 'Windows'
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: python -m pip install cibuildwheel -U
CIBW_BEFORE_ALL: python3 -m pip install cibuildwheel -U
CIBW_BUILD: 'cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64'
CIBW_BEFORE_TEST: python -m pip install --upgrade pip && python -m pip install -r requirements-test.txt
CIBW_BEFORE_TEST: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
cmd /V /C "set BLOSC_TRACE=1 && python -m pytest {project}/tests"
cmd /V /C "set BLOSC_TRACE=1 && python3 -m pytest {project}/tests"
- name: Build wheels (Linux / Mac OSX x86_64)
if: ${{ matrix.os != 'windows-latest' && matrix.arch != 'aarch64' }}
uses: pypa/[email protected]
env:
# The build requirements should be installed by the pyproject.toml specs
#CIBW_BEFORE_BUILD: python -m pip install --upgrade pip && python -m pip install -r requirements-build.txt
#CIBW_BEFORE_BUILD: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-build.txt
CIBW_BEFORE_BUILD_MACOS: CMAKE_OSX_ARCHITECTURES=x86_64
CIBW_BUILD: 'cp39-* cp310-* cp311-* cp312-*'
CIBW_BEFORE_TEST: python -m pip install --upgrade pip && python -m pip install -r requirements-test.txt
CIBW_BEFORE_TEST: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements-test.txt
CIBW_TEST_COMMAND: >
BLOSC_TRACE=1 python -m pytest {project}/tests
BLOSC_TRACE=1 python3 -m pytest {project}/tests
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: "x86_64"

Expand Down
9 changes: 6 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ set(CMAKE_FIND_FRAMEWORK NEVER)
add_subdirectory(grok)

# Build libblosc2_grok.so
if (MSVC OR MINGW)
if (APPLE AND {CMAKE_OSX_ARCHITECTURES} STREQUAL "arm64")
add_library(blosc2_grok SHARED blosc2_grok.cpp)
else()
add_library(blosc2_grok MODULE blosc2_grok.cpp)
endif()

if (MSVC OR MINGW)
# Necessary for compiling blosc2_grok.lib
set_property(TARGET blosc2_grok PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
else()
add_library(blosc2_grok SHARED blosc2_grok.cpp)
endif()

include_directories(
Expand Down

0 comments on commit abd95de

Please sign in to comment.