Skip to content

Commit 712b8f0

Browse files
authored
Merge pull request #23 from Yvictor/feat/py313
feat: support py3.13 and aarch64 linux
2 parents 1949ce6 + a4afe55 commit 712b8f0

File tree

4 files changed

+1193
-66
lines changed

4 files changed

+1193
-66
lines changed

.github/workflows/CI.yml

+74-41
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
permissions:
1919
contents: read
2020

21+
env:
22+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
23+
2124
jobs:
2225
linux:
2326
runs-on: ubuntu-latest
@@ -28,21 +31,34 @@ jobs:
2831
#, aarch64, armv7]
2932
steps:
3033
- uses: actions/checkout@v3
31-
- uses: actions/setup-python@v4
34+
- uses: actions/setup-python@v5
3235
with:
3336
python-version: '3.10'
37+
- name: install uv
38+
uses: astral-sh/setup-uv@v5
39+
- name: Install talib
40+
run: |
41+
wget https://github.com/Yvictor/polars_ta_extension/releases/download/0.1.0/ta-lib-0.4.0-src.tar.gz
42+
tar -xzf ta-lib-0.4.0-src.tar.gz
43+
cd ta-lib
44+
./configure
45+
make
46+
sudo make install
47+
cd ..
48+
rm -rf ta-lib
49+
env:
50+
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include
51+
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib
3452
- name: Test
3553
run: |
36-
python -m pip install --upgrade pip
37-
pip install .[dev]
38-
pytest
54+
uv run pytest
3955
env:
4056
DEPS_PATH: ${{ github.workspace }}/dependencies
4157
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include
4258
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib
4359
- name: Build wheels for x86_64
4460
if: matrix.target == 'x86_64'
45-
uses: PyO3/maturin-action@v1
61+
uses: PyO3/maturin-action@v1.46.0
4662
with:
4763
target: ${{ matrix.target }}
4864
args: --release --out dist --find-interpreter
@@ -100,35 +116,47 @@ jobs:
100116
name: wheels
101117
path: dist
102118

103-
# linux-arm:
104-
# runs-on: ubuntu-latest
105-
# strategy:
106-
# matrix:
107-
# target: [aarch64]
108-
# steps:
109-
# - uses: actions/checkout@v4
110-
# - uses: actions/setup-python@v4
111-
# with:
112-
# python-version: "3.10"
113-
# - name: Setup QEMU
114-
# uses: docker/setup-qemu-action@v1
115-
# - name: Build wheels
116-
# uses: PyO3/maturin-action@v1
117-
# with:
118-
# target: ${{ matrix.target }}
119-
# args: --release --out dist --find-interpreter
120-
# sccache: 'true'
121-
# container: ghcr.io/rust-cross/manylinux_2_28-cross:aarch64
122-
# rust-toolchain: stable-aarch64-unknown-linux-gnu
123-
# env:
124-
# DEPS_PATH: ${{ github.workspace }}/dependencies
125-
# TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include
126-
# TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib
127-
# - name: Upload wheels
128-
# uses: actions/upload-artifact@v3
129-
# with:
130-
# name: wheels
131-
# path: dist
119+
linux-arm:
120+
runs-on: ubuntu-24.04-arm
121+
strategy:
122+
matrix:
123+
target: [aarch64]
124+
# armv7l]
125+
steps:
126+
- uses: actions/checkout@v4
127+
- uses: actions/setup-python@v5
128+
with:
129+
python-version: "3.10"
130+
- name: install uv
131+
uses: astral-sh/setup-uv@v5
132+
- name: install tools
133+
run: |
134+
uv tool install maturin
135+
- name: Install talib
136+
run: |
137+
wget https://github.com/ta-lib/ta-lib/releases/download/v0.6.4/ta-lib-0.6.4-src.tar.gz
138+
tar -xzf ta-lib-0.6.4-src.tar.gz
139+
cd ta-lib-0.6.4
140+
./configure
141+
make
142+
sudo make install
143+
cd ..
144+
rm -rf ta-lib-0.6.4
145+
env:
146+
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include
147+
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib
148+
- name: Build wheels
149+
run: |
150+
maturin build --release --out dist --find-interpreter
151+
env:
152+
DEPS_PATH: ${{ github.workspace }}/dependencies
153+
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include
154+
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib
155+
- name: Upload wheels
156+
uses: actions/upload-artifact@v3
157+
with:
158+
name: wheels
159+
path: dist
132160

133161

134162
windows:
@@ -138,7 +166,7 @@ jobs:
138166
target: [x64, x86]
139167
steps:
140168
- uses: actions/checkout@v3
141-
- uses: actions/setup-python@v4
169+
- uses: actions/setup-python@v5
142170
with:
143171
python-version: '3.10'
144172
architecture: ${{ matrix.target }}
@@ -150,6 +178,11 @@ jobs:
150178
- uses: ilammy/msvc-dev-cmd@v1
151179
with:
152180
arch: ${{ matrix.target }}
181+
- name: install uv
182+
uses: astral-sh/setup-uv@v5
183+
- name: install tools
184+
run: |
185+
uv tool install maturin
153186
- name: Build wheels
154187
uses: PyO3/maturin-action@v1
155188
with:
@@ -173,14 +206,14 @@ jobs:
173206
target: [x86_64, aarch64-apple-darwin]
174207
steps:
175208
- uses: actions/checkout@v3
176-
- uses: actions/setup-python@v4
209+
- uses: actions/setup-python@v5
177210
with:
178211
python-version: '3.10'
179-
# - name: check python version
180-
# run: |
181-
# python --version
182-
# which python
183-
# python -m pip install -U pip
212+
- name: install uv
213+
uses: astral-sh/setup-uv@v5
214+
- name: install tools
215+
run: |
216+
uv tool install maturin
184217
- name: Build wheels
185218
uses: PyO3/maturin-action@v1
186219
with:

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polars_talib"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010

1111

1212
[dependencies]
13-
pyo3 = { version = "*", features = ["extension-module"] }
13+
pyo3 = { version = "0.20", features = ["extension-module", "abi3-py37"] }
1414
pyo3-polars = { version = "0.10.0", features = ["derive"] }
1515
polars = {version = "0.36.2", features = ["dtype-struct"]}
1616
# "performant", "lazy", "dtype-array"

pyproject.toml

+27-23
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,49 @@
1-
[build-system]
2-
requires = ["maturin>=1.4,<2.0"]
3-
build-backend = "maturin"
4-
51
[project]
6-
name = "polars_talib"
2+
name = "polars-talib"
3+
version = "0.1.5"
4+
description = "Polars extension for Ta-Lib: Support Ta-Lib functions in Polars expressions"
5+
readme = "README.md"
6+
authors = [
7+
{name = "yvictor", email = "[email protected]"}
8+
]
79
requires-python = ">=3.7"
810
classifiers = [
911
"Programming Language :: Rust",
1012
"Programming Language :: Python :: Implementation :: CPython",
1113
"Programming Language :: Python :: Implementation :: PyPy",
1214
]
13-
dynamic = ["version"]
14-
authors = [
15-
{name = "yvictor", email = "[email protected]"}
16-
]
17-
dependencies = [
18-
"polars >= 0.20",
19-
]
20-
description = "Polars extension for Ta-Lib: Support Ta-Lib functions in Polars expressions"
21-
readme = "README.md"
2215
keywords = ["polars-extension", "talib", "technical-analysis", "TA-Lib", "polars", "rust", "polars-expr"]
16+
dependencies = [
17+
"polars >= 0.18.0,<0.18.5; python_version < '3.8'",
18+
"polars >= 0.19; python_version >= '3.8'",
19+
]
20+
2321

2422
[tool.maturin]
23+
module-name = "polars_talib._polars_talib"
24+
python-packages = ["polars_talib"]
2525
python-source = "python"
2626
features = ["pyo3/extension-module"]
27-
module-name = "polars_talib._polars_talib"
2827

29-
[project.optional-dependencies]
28+
[build-system]
29+
requires = ["maturin>=1.0,<2.0"]
30+
build-backend = "maturin"
31+
32+
[dependency-groups]
3033
dev = [
31-
"pytest >= 7.4.1",
32-
"maturin[patchelf]",
33-
"polars",
34-
"numpy==1.26.4",
34+
"maturin>=1.8.1",
35+
"pytest>=7.4.1",
36+
"numpy==1.20.0; python_version < '3.9'",
37+
"numpy==1.26.4; python_version >= '3.9'",
3538
"memray",
3639
"hypothesis",
37-
"pytest-memray",
40+
"pytest-memray==1.4.0; python_version >= '3.8'",
3841
"pytest-benchmark",
39-
"ta-lib",
42+
"ta-lib==0.5.3",
4043
]
4144

45+
4246
[tool.ruff]
4347
line-length = 100
4448
fix = true
45-
src = ["python"]
49+
src = ["python"]

0 commit comments

Comments
 (0)