Build TA-Lib wheels for Linux #44
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 Linux | |
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 -U setuptools wheel numpy Cython | |
CIBW_TEST_REQUIRES: pytest pandas polars | |
CIBW_TEST_COMMAND: > | |
cd .. && | |
pytest --rootdir=C: -k "not RSI and not threading" {project}/tests | |
CIBW_TEST_SKIP: "*win32 cp37* cp38* cp39*" | |
CIBW_SKIP: "pp* cp36*" | |
jobs: | |
build_x86_64: | |
name: Build Linux x86_64 Python ${{ matrix.python-version }} wheels | |
strategy: | |
matrix: | |
os: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
runs-on: ${{ matrix.os }} | |
env: | |
PY_VER: ${{matrix.python-version}} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Capture ldd version | |
id: ldd_version | |
run: | | |
LDD_VERSION=$(ldd --version | head -n 1 | awk '{print $NF}') | |
echo "LDD_VERSION=${LDD_VERSION}" >> $GITHUB_ENV | |
- name: Install GCC and CMake | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc g++ cmake | |
- name: Verify GCC and CMake | |
run: | | |
gcc --version | |
g++ --version | |
cmake --version | |
- name: Make script executable | |
run: chmod +x build_linux.sh | |
- name: Build TA-Lib | |
run: ./build_linux.sh | |
shell: bash | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.22.0 | |
env: | |
CIBW_ARCHS_LINUX: x86_64 | |
CIBW_BUILD_FRONTEND: build | |
CIBW_ENVIRONMENT_LINUX : > | |
TA_LIBRARY_PATH="ta-lib-install/lib" | |
TA_INCLUDE_PATH="ta-lib-install/include" | |
LD_LIBRARY_PATH="ta-lib-install/lib" | |
PIP_NO_BUILD_ISOLATION=false | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: | | |
export LD_LIBRARY_PATH="/project/ta-lib-install/lib" | |
auditwheel repair --lib-sdir ta-lib-install/lib -w {dest_dir} {wheel} | |
- name: Set wheel name | |
run: | | |
echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-cp${PY_VER//./}-cp${PY_VER//./}-manylinux_${LDD_VERSION//./_}_x86_64.whl" >> $GITHUB_ENV | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./wheelhouse/*.whl | |
name: ${{ env.WHEEL_NAME }} |