Repository navigation
Build static TA-Lib C source #359
This file contains hidden or 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: Tests | |
| # master and the dev-* release branches test against the TA-Lib C release the | |
| # wheels are built from. dev tracks TA-Lib C's dev branch, in tests-dev.yml. | |
| on: | |
| push: | |
| branches: [ master, 'dev-*' ] | |
| pull_request: | |
| branches: [ master, 'dev-*' ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: TA-Lib C version | |
| id: talib_c | |
| run: | | |
| set -euo pipefail | |
| V=$(sed -n 's/^ TALIB_C_VER: *//p' .github/workflows/wheels.yml) | |
| [ -n "$V" ] || { echo "::error::no TALIB_C_VER in wheels.yml"; exit 1; } | |
| echo "version=$V" >> "$GITHUB_OUTPUT" | |
| - name: Set up TA-Lib | |
| uses: TA-Lib/setup-ta-lib@v1 | |
| with: | |
| version: ${{ steps.talib_c.outputs.version }} | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip wheel setuptools | |
| if [[ "${{ matrix.python-version }}" == *t ]]; then | |
| # Polars has no free-threaded wheels; exercise NumPy and pandas here. | |
| pip install -r requirements.txt pytest pandas | |
| else | |
| pip install -r requirements_test.txt | |
| fi | |
| pip install flake8 | |
| - name: Build cython modules in-place | |
| env: | |
| TA_INCLUDE_PATH: /usr/include | |
| TA_LIBRARY_PATH: /usr/lib | |
| run: | | |
| python setup.py build_ext --inplace | |
| ldd talib/_ta_lib*.so | grep -E 'libta-lib\.so[^ ]* => /' | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| flake8 talib --count --select=E9,F63,F7,F82 --show-source --statistics | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| #flake8 talib --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Test with pytest | |
| run: | | |
| PYTHONPATH=. pytest |