|
| 1 | + |
| 2 | +name: TA-Lib-python GitHub Actions to build wheels |
| 3 | +run-name: TA-Lib-python GitHub Actions to build wheels |
| 4 | +on: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - "v*" |
| 8 | + |
| 9 | +env: |
| 10 | + TALIB_C_VER: 0.4.0 |
| 11 | + TALIB_PY_VER: ${{ github.ref_name }} |
| 12 | + |
| 13 | +jobs: |
| 14 | + build_manylinux_x86_64: |
| 15 | + name: Build ManyLinux x86_64 wheels |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: ["ubuntu-22.04"] |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + env: |
| 21 | + PIP_NO_VERIFY: 0 |
| 22 | + PIP_VERBOSE: 1 |
| 23 | + CIBW_BUILD_VERBOSITY: 2 |
| 24 | + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 |
| 25 | + CIBW_MANYLINUX_I686_IMAGE: manylinux_2_28 |
| 26 | + CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28 |
| 27 | + CIBW_MANYLINUX_PYPY_I686_IMAGE: manylinux_2_28 |
| 28 | + CIBW_BEFORE_BUILD: pip install setuptools==58.0.1&&pip install -U Cython&&pip install -U wheel numpy |
| 29 | + CIBW_BEFORE_TEST: pip install -U Cython |
| 30 | + CIBW_TEST_REQUIRES: pytest pandas polars |
| 31 | + CIBW_TEST_COMMAND: > |
| 32 | + cd .. && |
| 33 | + pytest -k "not RSI and not threading" {project}/tests |
| 34 | + CIBW_TEST_SKIP: "*win32 cp*" |
| 35 | + CIBW_SKIP: "pp* cp*-musllinux*" |
| 36 | + steps: |
| 37 | + - name: Checkout repository |
| 38 | + uses: actions/checkout@v4 |
| 39 | + - name: Install GCC and CMake |
| 40 | + run: | |
| 41 | + sudo apt-get update |
| 42 | + sudo apt-get install -y gcc g++ cmake |
| 43 | + - name: Make script executable |
| 44 | + run: chmod +x ./tools/build_wheel_linux.sh |
| 45 | + - name: Build TA-Lib |
| 46 | + run: ./tools/build_wheel_linux.sh |
| 47 | + shell: bash |
| 48 | + - name: Build wheels |
| 49 | + |
| 50 | + env: |
| 51 | + CIBW_ARCHS_LINUX: x86_64 |
| 52 | + CIBW_BUILD_FRONTEND: build |
| 53 | + CIBW_ENVIRONMENT_LINUX : > |
| 54 | + TA_LIBRARY_PATH="ta-lib-install/lib" |
| 55 | + TA_INCLUDE_PATH="ta-lib-install/include" |
| 56 | + PIP_NO_BUILD_ISOLATION=false |
| 57 | + CIBW_REPAIR_WHEEL_COMMAND_LINUX: | |
| 58 | + export LD_LIBRARY_PATH="/project/ta-lib-install/lib:$LD_LIBRARY_PATH" |
| 59 | + auditwheel repair -w {dest_dir} {wheel} |
| 60 | + - name: Set wheel name |
| 61 | + run: | |
| 62 | + echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-manylinux_x86_64" >> $GITHUB_ENV |
| 63 | + - name: Upload wheels |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + path: ./wheelhouse/*.whl |
| 67 | + name: ${{ env.WHEEL_NAME }} |
| 68 | + |
| 69 | + build_musllinux_x86_64: |
| 70 | + name: Build MuslLinux x86_64 wheels |
| 71 | + strategy: |
| 72 | + matrix: |
| 73 | + os: ["ubuntu-22.04"] |
| 74 | + runs-on: ${{ matrix.os }} |
| 75 | + env: |
| 76 | + PIP_NO_VERIFY: 0 |
| 77 | + PIP_VERBOSE: 1 |
| 78 | + CIBW_BUILD_VERBOSITY: 2 |
| 79 | + CIBW_BEFORE_BUILD: pip install setuptools==58.0.1&&pip install Cython==0.29.37&&pip install -U wheel numpy |
| 80 | + CIBW_BEFORE_TEST: apk add bash&&bash setup_rust.sh&&. "$HOME/.cargo/env"&&pip install Cython==0.29.37&&pip install -U maturin&&pip install -U polars |
| 81 | + CIBW_TEST_REQUIRES: pytest pandas polars |
| 82 | + CIBW_TEST_COMMAND: > |
| 83 | + cd .. && |
| 84 | + pytest -k "not RSI and not threading" {project}/tests |
| 85 | + CIBW_TEST_SKIP: "*win32 cp*" |
| 86 | + CIBW_SKIP: "pp* cp*-manylinux*" |
| 87 | + steps: |
| 88 | + - name: Checkout repository |
| 89 | + uses: actions/checkout@v4 |
| 90 | + - name: Setup latest Alpine Linux |
| 91 | + uses: jirutka/setup-alpine@v1 |
| 92 | + with: |
| 93 | + branch: v3.15 |
| 94 | + packages: > |
| 95 | + build-base |
| 96 | + bash |
| 97 | + curl |
| 98 | + unzip |
| 99 | + gcc |
| 100 | + g++ |
| 101 | + cmake |
| 102 | + volumes: ${{ github.workspace }}:/project |
| 103 | + - name: Make script executable |
| 104 | + run: chmod +x ./tools/build_wheel_linux.sh |
| 105 | + - name: Build TA-Lib |
| 106 | + run: | |
| 107 | + ./tools/build_wheel_linux.sh |
| 108 | + shell: alpine.sh {0} |
| 109 | + - name: Build wheels |
| 110 | + |
| 111 | + env: |
| 112 | + CIBW_ARCHS_LINUX: x86_64 |
| 113 | + CIBW_BUILD_FRONTEND: build |
| 114 | + CIBW_ENVIRONMENT_LINUX : > |
| 115 | + TA_LIBRARY_PATH="ta-lib-install/lib" |
| 116 | + TA_INCLUDE_PATH="ta-lib-install/include" |
| 117 | + PIP_NO_BUILD_ISOLATION=false |
| 118 | + CIBW_REPAIR_WHEEL_COMMAND_LINUX: | |
| 119 | + export LD_LIBRARY_PATH="/project/ta-lib-install/lib:$LD_LIBRARY_PATH" |
| 120 | + auditwheel repair -w {dest_dir} {wheel} |
| 121 | + - name: Set wheel name |
| 122 | + run: | |
| 123 | + echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-musllinux_x86_64" >> $GITHUB_ENV |
| 124 | + - name: Upload wheels |
| 125 | + uses: actions/upload-artifact@v4 |
| 126 | + with: |
| 127 | + path: ./wheelhouse/*.whl |
| 128 | + name: ${{ env.WHEEL_NAME }} |
| 129 | + |
| 130 | + build_windows_amd64: |
| 131 | + name: Build Windows amd64 wheels |
| 132 | + strategy: |
| 133 | + matrix: |
| 134 | + os: ["windows-2022"] |
| 135 | + runs-on: ${{ matrix.os }} |
| 136 | + env: |
| 137 | + MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT: 1 |
| 138 | + steps: |
| 139 | + - name: Checkout the repository |
| 140 | + uses: actions/checkout@v4 |
| 141 | + - name: Set up MSVC for x64 |
| 142 | + uses: ilammy/msvc-dev-cmd@v1 |
| 143 | + with: |
| 144 | + arch: amd64 |
| 145 | + - name: Build TA-Lib C library |
| 146 | + run: tools/build_wheel_windows.cmd |
| 147 | + shell: cmd |
| 148 | + - name: Build wheels |
| 149 | + |
| 150 | + env: |
| 151 | + PIP_NO_VERIFY: 0 |
| 152 | + PIP_VERBOSE: 1 |
| 153 | + CIBW_BUILD_VERBOSITY: 2 |
| 154 | + CIBW_BEFORE_BUILD: pip install -U setuptools wheel numpy Cython |
| 155 | + CIBW_TEST_REQUIRES: pytest pandas polars |
| 156 | + CIBW_TEST_COMMAND: > |
| 157 | + cd .. && |
| 158 | + pytest --rootdir=C: -k "not RSI and not threading" {project}/tests |
| 159 | + CIBW_TEST_SKIP: "*win32*" |
| 160 | + CIBW_SKIP: "pp*" |
| 161 | + CIBW_ARCHS_WINDOWS: AMD64 |
| 162 | + CIBW_ENVIRONMENT_WINDOWS: > |
| 163 | + TA_LIBRARY_PATH="ta-lib-$TALIB_C_VER\\_build;$LIB" |
| 164 | + TA_INCLUDE_PATH="ta-lib-$TALIB_C_VER\\include;$INCLUDE" |
| 165 | + PIP_NO_BUILD_ISOLATION=false |
| 166 | + - name: Set wheel name |
| 167 | + run: | |
| 168 | + echo ("WHEEL_NAME=" + "ta_lib-" + $env:TALIB_PY_VER + "-win_amd64") >> $env:GITHUB_ENV |
| 169 | + - name: Upload wheel |
| 170 | + uses: actions/upload-artifact@v4 |
| 171 | + with: |
| 172 | + path: ./wheelhouse/*.whl |
| 173 | + name: ${{ env.WHEEL_NAME }} |
| 174 | + |
| 175 | + build_windows_x86: |
| 176 | + name: Build Windows x86 wheels |
| 177 | + strategy: |
| 178 | + matrix: |
| 179 | + os: ["windows-2022"] |
| 180 | + runs-on: ${{ matrix.os }} |
| 181 | + env: |
| 182 | + MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT: 1 |
| 183 | + steps: |
| 184 | + - name: Checkout the repository |
| 185 | + uses: actions/checkout@v4 |
| 186 | + |
| 187 | + - name: Set up MSVC for x86 |
| 188 | + uses: ilammy/msvc-dev-cmd@v1 |
| 189 | + with: |
| 190 | + arch: amd64_x86 |
| 191 | + |
| 192 | + - name: Build TA-Lib C library |
| 193 | + run: tools/build_wheel_windows.cmd |
| 194 | + shell: cmd |
| 195 | + |
| 196 | + - name: Build wheels |
| 197 | + |
| 198 | + env: |
| 199 | + PIP_NO_VERIFY: 0 |
| 200 | + PIP_VERBOSE: 1 |
| 201 | + CIBW_BUILD_VERBOSITY: 2 |
| 202 | + CIBW_BEFORE_BUILD: pip install -U setuptools wheel numpy Cython |
| 203 | + CIBW_TEST_REQUIRES: pytest pandas polars |
| 204 | + CIBW_TEST_COMMAND: > |
| 205 | + cd .. && |
| 206 | + pytest --rootdir=C: -k "not RSI and not threading" {project}/tests |
| 207 | + CIBW_TEST_SKIP: "*win32 cp*" |
| 208 | + CIBW_SKIP: "pp*" |
| 209 | + MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT: 1 |
| 210 | + CIBW_ARCHS_WINDOWS: x86 |
| 211 | + CIBW_ENVIRONMENT_WINDOWS: > |
| 212 | + TA_LIBRARY_PATH="ta-lib-$TALIB_C_VER\\_build;$LIB" |
| 213 | + TA_INCLUDE_PATH="ta-lib-$TALIB_C_VER\\include;$INCLUDE" |
| 214 | + PIP_NO_BUILD_ISOLATION=false |
| 215 | +
|
| 216 | + - name: Set wheel name |
| 217 | + run: | |
| 218 | + echo ("WHEEL_NAME=" + "ta_lib-" + $env:TALIB_PY_VER + "-win32") >> $env:GITHUB_ENV |
| 219 | +
|
| 220 | + - name: Upload wheel |
| 221 | + uses: actions/upload-artifact@v4 |
| 222 | + with: |
| 223 | + path: ./wheelhouse/*.whl |
| 224 | + name: ${{ env.WHEEL_NAME }} |
| 225 | + |
| 226 | + build_macos_x86_64: |
| 227 | + name: Build MacOS x86_64 wheels |
| 228 | + strategy: |
| 229 | + matrix: |
| 230 | + os: [macos-13] |
| 231 | + runs-on: ${{ matrix.os }} |
| 232 | + steps: |
| 233 | + - name: Checkout repository |
| 234 | + uses: actions/checkout@v4 |
| 235 | + |
| 236 | + - name: Make script executable |
| 237 | + run: chmod +x ./tools/build_wheel_macos.sh |
| 238 | + |
| 239 | + - name: Build TA-Lib |
| 240 | + run: ./tools/build_wheel_macos.sh |
| 241 | + shell: bash |
| 242 | + |
| 243 | + - name: Build wheels |
| 244 | + |
| 245 | + env: |
| 246 | + PIP_NO_VERIFY: 0 |
| 247 | + PIP_VERBOSE: 1 |
| 248 | + CIBW_BUILD_VERBOSITY: 2 |
| 249 | + CIBW_BEFORE_BUILD: python -c "import sys; from subprocess import call; call(['pip', 'install', 'setuptools==58.0.1' if sys.version_info <= (3, 11) else '-U', 'setuptools'])"&&pip install -U wheel numpy Cython |
| 250 | + CIBW_TEST_REQUIRES: pytest pandas polars |
| 251 | + CIBW_TEST_COMMAND: > |
| 252 | + cd .. && |
| 253 | + pytest -k "not RSI and not threading" {project}/tests |
| 254 | + CIBW_TEST_SKIP: "*win32 cp*" |
| 255 | + CIBW_SKIP: "pp*" |
| 256 | + CIBW_ARCHS_MACOS: x86_64 |
| 257 | + CIBW_ENVIRONMENT_MACOS : > |
| 258 | + TA_LIBRARY_PATH="ta-lib-install/lib" |
| 259 | + TA_INCLUDE_PATH="ta-lib-install/include" |
| 260 | + PIP_NO_BUILD_ISOLATION=false |
| 261 | + CIBW_REPAIR_WHEEL_COMMAND_MACOS: | |
| 262 | + export MACOSX_DEPLOYMENT_TARGET=13.7 |
| 263 | + export DYLD_LIBRARY_PATH="/Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/ta-lib-install/lib:$DYLD_LIBRARY_PATH" |
| 264 | + delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} |
| 265 | +
|
| 266 | + - name: Set wheel name |
| 267 | + run: | |
| 268 | + echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-macos_x86_64" >> $GITHUB_ENV |
| 269 | +
|
| 270 | + - name: Upload wheels |
| 271 | + uses: actions/upload-artifact@v4 |
| 272 | + with: |
| 273 | + path: ./wheelhouse/*.whl |
| 274 | + name: ${{ env.WHEEL_NAME }} |
| 275 | + |
| 276 | + build_macos_arm64: |
| 277 | + name: Build MacOS arm64 wheels |
| 278 | + strategy: |
| 279 | + matrix: |
| 280 | + os: [macos-14] |
| 281 | + runs-on: ${{ matrix.os }} |
| 282 | + steps: |
| 283 | + - name: Checkout repository |
| 284 | + uses: actions/checkout@v4 |
| 285 | + |
| 286 | + - name: Make script executable |
| 287 | + run: chmod +x ./tools/build_wheel_macos.sh |
| 288 | + |
| 289 | + - name: Build TA-Lib |
| 290 | + run: ./tools/build_wheel_macos.sh |
| 291 | + shell: bash |
| 292 | + |
| 293 | + - name: Build wheels |
| 294 | + |
| 295 | + env: |
| 296 | + PIP_NO_VERIFY: 0 |
| 297 | + PIP_VERBOSE: 1 |
| 298 | + CIBW_BUILD_VERBOSITY: 2 |
| 299 | + CIBW_BEFORE_BUILD: python -c "import sys; from subprocess import call; call(['pip', 'install', 'setuptools==58.0.1' if sys.version_info <= (3, 11) else '-U', 'setuptools'])"&&pip install -U wheel numpy Cython |
| 300 | + CIBW_TEST_REQUIRES: pytest pandas polars |
| 301 | + CIBW_TEST_COMMAND: > |
| 302 | + cd .. && |
| 303 | + pytest -k "not RSI and not threading" {project}/tests |
| 304 | + CIBW_TEST_SKIP: "*win32 cp*" |
| 305 | + CIBW_SKIP: "pp*" |
| 306 | + CIBW_ARCHS_MACOS: arm64 |
| 307 | + CIBW_ENVIRONMENT_MACOS : > |
| 308 | + TA_LIBRARY_PATH="ta-lib-install/lib" |
| 309 | + TA_INCLUDE_PATH="ta-lib-install/include" |
| 310 | + PIP_NO_BUILD_ISOLATION=false |
| 311 | + CIBW_REPAIR_WHEEL_COMMAND_MACOS: | |
| 312 | + export MACOSX_DEPLOYMENT_TARGET=14.0 |
| 313 | + export DYLD_LIBRARY_PATH="/Users/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/ta-lib-install/lib:$DYLD_LIBRARY_PATH" |
| 314 | + delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} |
| 315 | +
|
| 316 | + - name: Set wheel name |
| 317 | + run: | |
| 318 | + echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-macosx_arm64" >> $GITHUB_ENV |
| 319 | +
|
| 320 | + - name: Upload wheels |
| 321 | + uses: actions/upload-artifact@v4 |
| 322 | + with: |
| 323 | + path: ./wheelhouse/*.whl |
| 324 | + name: ${{ env.WHEEL_NAME }} |
0 commit comments