Skip to content

Commit 6ca3626

Browse files
committed
Patch for polars-lts-cpu support
1 parent e367f9a commit 6ca3626

19 files changed

+48
-509
lines changed

.cargo/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-pc-windows-msvc]
2+
rustflags = ["-C", "target-feature=+crt-static"]
3+
4+
[target.'cfg(target_arch = "x86_64")']
5+
rustflags = ["-C", "target-feature=+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+cmpxchg16b"]

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/CI.yml

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ defaults:
2222
shell: bash
2323

2424
env:
25-
PYTHON_VERSION: '3.9'
25+
PYTHON_VERSION: '3.10.11'
2626

2727
jobs:
2828
create-sdist:
2929
runs-on: ubuntu-latest
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
package: [polars_ds]
33+
package: [polars-ds-lts-cpu]
3434

3535
steps:
3636
- uses: actions/checkout@v4
@@ -49,7 +49,7 @@ jobs:
4949
args: >
5050
--manifest-path Cargo.toml
5151
--out dist
52-
maturin-version: 1.7.4
52+
maturin-version: 1.9.6
5353

5454
- name: Test sdist
5555
run: |
@@ -75,7 +75,7 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
package: [polars_ds]
78+
package: [polars-ds-lts-cpu]
7979
os: [ubuntu-latest, macos-13, windows-latest]
8080
architecture: [x86-64, aarch64]
8181
exclude:
@@ -95,40 +95,21 @@ jobs:
9595
- name: Determine CPU features for x86-64
9696
id: features
9797
if: matrix.architecture == 'x86-64'
98-
99-
# env:
100-
# IS_LTS_CPU: ${{ matrix.package == 'polars_ds_lts_cpu' }}
101-
102-
# if [[ "$IS_LTS_CPU" = true ]]; then
103-
# FEATURES=+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+cmpxchg16b
104-
# CC_FEATURES="-msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mcx16"
105-
# else
106-
# fi
10798
run: |
108-
TUNE_CPU=skylake
109-
FEATURES=+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+cmpxchg16b,+avx,+avx2,+fma,+bmi1,+bmi2,+lzcnt,+pclmulqdq,+movbe
110-
CC_FEATURES="-msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mcx16 -mavx -mavx2 -mfma -mbmi -mbmi2 -mlzcnt -mpclmul -mmovbe"
99+
FEATURES=+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+cmpxchg16b
100+
CC_FEATURES="-msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mcx16"
111101
112102
echo "features=$FEATURES" >> $GITHUB_OUTPUT
113-
echo "tune_cpu=$TUNE_CPU" >> $GITHUB_OUTPUT
114103
echo "cc_features=$CC_FEATURES" >> $GITHUB_OUTPUT
115104
116105
- name: Set RUSTFLAGS for x86-64
117106
if: matrix.architecture == 'x86-64'
118107
env:
119108
FEATURES: ${{ steps.features.outputs.features }}
120-
TUNE_CPU: ${{ steps.features.outputs.tune_cpu }}
121109
CC_FEATURES: ${{ steps.features.outputs.cc_features }}
122-
# CFG: ${{ matrix.package == 'polars_ds_lts_cpu' && '--cfg allocator="default"' || '' }}
123-
# add $CFG
124110
run: |
125-
if [[ -z "$TUNE_CPU" ]]; then
126-
echo "RUSTFLAGS=-C target-feature=$FEATURES" >> $GITHUB_ENV
127-
echo "CFLAGS=$CC_FEATURES" >> $GITHUB_ENV
128-
else
129-
echo "RUSTFLAGS=-C target-feature=$FEATURES -Z tune-cpu=$TUNE_CPU" >> $GITHUB_ENV
130-
echo "CFLAGS=$CC_FEATURES -mtune=$TUNE_CPU" >> $GITHUB_ENV
131-
fi
111+
echo "RUSTFLAGS=-C target-feature=$FEATURES" >> $GITHUB_ENV
112+
echo "CFLAGS=$CC_FEATURES" >> $GITHUB_ENV
132113
133114
- name: Set Rust target for aarch64
134115
if: matrix.architecture == 'aarch64'
@@ -158,7 +139,7 @@ jobs:
158139
--manifest-path Cargo.toml
159140
--out dist
160141
manylinux: ${{ matrix.architecture == 'aarch64' && '2_24' || 'auto' }}
161-
maturin-version: 1.7.4
142+
maturin-version: 1.9.6
162143

163144
- name: Test wheel
164145
# Only test on x86-64 for now as this matches the runner architecture
@@ -181,7 +162,7 @@ jobs:
181162
release:
182163
name: Release
183164
runs-on: ubuntu-latest
184-
if: "startsWith(github.ref, 'refs/tags/')"
165+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
185166
needs: [build-wheels, create-sdist]
186167
permissions:
187168
id-token: write
@@ -198,6 +179,8 @@ jobs:
198179

199180
- name: Publish to PyPI
200181
uses: PyO3/maturin-action@v1
182+
env:
183+
MATURIN_PYPI_TOKEN: ${{ secrets.MATURIN_PYPI_TOKEN }}
201184
with:
202185
command: upload
203186
args: --non-interactive --skip-existing *

.github/workflows/python-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
os: [ubuntu-latest]
39-
python-version: ['3.9', '3.12', '3.13']
39+
python-version: ['3.10', '3.12', '3.13']
4040
# include:
4141
# - os: windows-latest
4242
# python-version: '3.13'
@@ -65,7 +65,6 @@ jobs:
6565
- name: Install Python dependencies
6666
run: |
6767
python -m pip install --upgrade pip
68-
pip install jupyter ipython ipykernel nbconvert pytest
6968
pip install -r tests/requirements-test.txt
7069
7170
- name: Test Notebooks

.readthedocs.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ crate-type = ["cdylib"]
1212
[dependencies]
1313
# PyO3
1414
numpy = "0.25" # matrix interop
15-
pyo3 = {version = "0.25", features = ["abi3-py39", "extension-module"]}
15+
pyo3 = {version = "0.25", features = ["abi3-py310", "extension-module"]}
1616
pyo3-polars = {version = "0.24", features = ["derive", "lazy"]}
1717
# Polars
1818
polars = {version = "0.51", features = ["lazy",

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ else
99
endif
1010

1111
.venv:
12-
python3 -m venv $(VENV)
12+
rustup update
13+
mise exec python@3.12.10 -- python -m venv --clear $(VENV)
1314
$(MAKE) requirements
1415

1516
requirements: .venv

0 commit comments

Comments
 (0)