feat: support py3.13 and aarch64 linux #106
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
# This file is autogenerated by maturin v1.4.0 | |
# To update, run | |
# | |
# maturin generate-ci github | |
# | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- master | |
tags: | |
- '*' | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [x86_64] | |
#, aarch64-unknown-linux-gnu] | |
#, aarch64, armv7] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Install talib | |
run: | | |
wget https://github.com/Yvictor/polars_ta_extension/releases/download/0.1.0/ta-lib-0.4.0-src.tar.gz | |
tar -xzf ta-lib-0.4.0-src.tar.gz | |
cd ta-lib | |
./configure | |
make | |
sudo make install | |
cd .. | |
rm -rf ta-lib | |
env: | |
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include | |
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib | |
- name: Test | |
run: | | |
uv run pytest | |
env: | |
DEPS_PATH: ${{ github.workspace }}/dependencies | |
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include | |
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib | |
- name: Build wheels for x86_64 | |
if: matrix.target == 'x86_64' | |
uses: PyO3/[email protected] | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --find-interpreter | |
sccache: 'true' | |
manylinux: auto | |
docker-options: -e LIBCLANG_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64/ -e LIBCLANG_STATIC_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64/ -e CLANG_PATH=/opt/rh/llvm-toolset-7/root/usr/bin/clang | |
before-script-linux: | | |
# If we're running on rhel centos, install needed packages. | |
if command -v yum &> /dev/null; then | |
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic centos-release-scl llvm-toolset-7 && echo 'source scl_source enable llvm-toolset-7' >> ~/.bashrc | |
# && source scl_source enable llvm-toolset-7 | |
# If we're running on i686 we need to symlink libatomic | |
# in order to build openssl with -latomic flag. | |
if [[ ! -d "/usr/lib64" ]]; then | |
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so | |
fi | |
else | |
# If we're running on debian-based system. | |
apt update -y && apt-get install -y libssl-dev openssl pkg-config libclang-dev gcc-multilib | |
fi | |
env: | |
DEPS_PATH: ${{ github.workspace }}/dependencies | |
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include | |
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib | |
- name: Build wheels for aarch64-unknown-linux-gnu | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --find-interpreter | |
sccache: 'true' | |
manylinux: auto | |
docker-options: -e LIBCLANG_PATH=/usr/lib/llvm-14/lib/ -e LIBCLANG_STATIC_PATH=/usr/lib/llvm-14/lib/ -e CLANG_PATH=/usr/lib/llvm-14/bin/clang | |
before-script-linux: | | |
# If we're running on rhel centos, install needed packages. | |
if command -v yum &> /dev/null; then | |
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic centos-release-scl llvm-toolset-7 && echo 'source scl_source enable llvm-toolset-7' >> ~/.bashrc | |
# && source scl_source enable llvm-toolset-7 | |
# If we're running on i686 we need to symlink libatomic | |
# in order to build openssl with -latomic flag. | |
if [[ ! -d "/usr/lib64" ]]; then | |
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so | |
fi | |
else | |
# If we're running on debian-based system. | |
apt update -y && apt-get install -y libssl-dev openssl pkg-config libclang-dev gcc-multilib | |
fi | |
env: | |
DEPS_PATH: ${{ github.workspace }}/dependencies | |
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include | |
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
linux-arm: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [aarch64, armv7l] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: install tools | |
run: | | |
uv tool install maturin | |
- name: Build wheels | |
uses: PyO3/[email protected] | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --find-interpreter | |
docker-options: -e LIBCLANG_PATH=/usr/lib/llvm-14/lib/ -e LIBCLANG_STATIC_PATH=/usr/lib/llvm-14/lib/ -e CLANG_PATH=/usr/lib/llvm-14/bin/clang | |
before-script-linux: | | |
# If we're running on rhel centos, install needed packages. | |
if command -v yum &> /dev/null; then | |
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic centos-release-scl llvm-toolset-7 && echo 'source scl_source enable llvm-toolset-7' >> ~/.bashrc | |
# && source scl_source enable llvm-toolset-7 | |
# If we're running on i686 we need to symlink libatomic | |
# in order to build openssl with -latomic flag. | |
if [[ ! -d "/usr/lib64" ]]; then | |
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so | |
fi | |
else | |
# If we're running on debian-based system. | |
apt update -y && apt-get install -y libssl-dev openssl pkg-config libclang-dev gcc-multilib | |
fi | |
env: | |
DEPS_PATH: ${{ github.workspace }}/dependencies | |
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include | |
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
target: [x64, x86] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
architecture: ${{ matrix.target }} | |
- name: Set up Clang | |
uses: egor-tensin/setup-clang@v1 | |
with: | |
version: latest | |
platform: ${{ matrix.target }} | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.target }} | |
- name: install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: install tools | |
run: | | |
uv tool install maturin | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --find-interpreter | |
sccache: 'true' | |
env: | |
DEPS_PATH: ${{ github.workspace }}\dependencies | |
TA_INCLUDE_PATH: ${{ github.workspace }}\dependencies\include | |
TA_LIBRARY_PATH: ${{ github.workspace }}\dependencies\lib | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: [x86_64, aarch64-apple-darwin] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: install tools | |
run: | | |
uv tool install maturin | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --find-interpreter | |
sccache: 'true' | |
env: | |
DEPS_PATH: ${{ github.workspace }}/dependencies | |
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include | |
TA_LIBRARY_PATH: ${{ github.workspace }}/dependencies/lib | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [linux, macos, windows] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --non-interactive --skip-existing * |