Build TA-Lib wheels for MacOS #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build TA-Lib wheels for MacOS | |
on: | |
workflow_dispatch: | |
env: | |
TALIB_C_VER: 0.6.2 | |
TALIB_PY_VER: 0.6.0 | |
PIP_NO_VERIFY: 0 | |
PIP_VERBOSE: 1 | |
CIBW_BUILD_VERBOSITY: 2 | |
CIBW_BEFORE_BUILD: pip install setuptools==58.0.1&&pip install -U wheel numpy Cython | |
CIBW_TEST_REQUIRES: pytest pandas polars | |
CIBW_TEST_COMMAND: > | |
cd .. && | |
pytest -k "not RSI and not threading" {project}/tests | |
CIBW_TEST_SKIP: "*win32 cp37* cp38* cp39*" | |
CIBW_SKIP: "pp*" | |
jobs: | |
build_x86_64: | |
name: Build MacOS x86_64 wheels | |
strategy: | |
matrix: | |
os: [macos-13] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Make script executable | |
run: chmod +x build_macos.sh | |
- name: Build TA-Lib | |
run: ./build_macos.sh | |
shell: bash | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.22.0 | |
env: | |
CIBW_ARCHS_MACOS: x86_64 | |
CIBW_ENVIRONMENT_MACOS : > | |
TA_LIBRARY_PATH="ta-lib-install/lib" | |
TA_INCLUDE_PATH="ta-lib-install/include" | |
PIP_NO_BUILD_ISOLATION=false | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: | | |
export DYLD_LIBRARY_PATH="/Users/runner/work/talib-prebuilt/talib-prebuilt/ta-lib-install/lib:$DYLD_LIBRARY_PATH" | |
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} | |
- name: Set wheel name | |
run: | | |
echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-macos_x86_64" >> $GITHUB_ENV | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./wheelhouse/*.whl | |
name: ${{ env.WHEEL_NAME }} | |
build_arm64: | |
name: Build MacOS arm64 wheels | |
strategy: | |
matrix: | |
os: [macos-15] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Make script executable | |
run: chmod +x build_macos.sh | |
- name: Build TA-Lib | |
run: ./build_macos.sh | |
shell: bash | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.22.0 | |
env: | |
CIBW_ARCHS_MACOS: arm64 | |
CIBW_ENVIRONMENT_MACOS : > | |
TA_LIBRARY_PATH="ta-lib-install/lib" | |
TA_INCLUDE_PATH="ta-lib-install/include" | |
PIP_NO_BUILD_ISOLATION=false | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: | | |
export DYLD_LIBRARY_PATH="/Users/runner/work/talib-prebuilt/talib-prebuilt/ta-lib-install/lib:$DYLD_LIBRARY_PATH" | |
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} | |
- name: Set wheel name | |
run: | | |
echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-macosx_arm64.whl" >> $GITHUB_ENV | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./wheelhouse/*.whl | |
name: ${{ env.WHEEL_NAME }} |