Repository navigation
67 lines (58 loc) · 2.11 KB
/
Copy pathtests.yml
File metadata and controls
67 lines (58 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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_VERSION = '\(.*\)'$/\1/p" setup.py)
[ -n "$V" ] || { echo "::error::no TALIB_C_VERSION in setup.py"; 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