Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Dec 8, 2024
1 parent 41fe4ff commit f391da9
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 34 deletions.
88 changes: 56 additions & 32 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# This file is autogenerated by maturin v1.4.0
# To update, run
# This file is based on the autogenerated one by maturin v1.7.8 with:
#
# maturin generate-ci github --pytest
# maturin generate-ci github
#
# Differences are:
# - removed x86, armv7, s390x, ppc64le targets from Linux
# - removed free-threaded wheels
# - removed musllinux
# - have separate linux-just-test and linux-min-versions-just-test jobs
# - add the `RUSTFLAGS: "-Dwarnings"` env variable

name: CI

on:
Expand All @@ -15,10 +21,6 @@ on:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand All @@ -27,12 +29,12 @@ env:
RUSTFLAGS: "-Dwarnings"

jobs:
linux_tests:
linux-just-test:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.11", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -47,12 +49,12 @@ jobs:
- run: make install
- run: make test

linux_min_version_tests:
linux-min-versions-just-test:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
python-version: ["3.8"]
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -63,76 +65,86 @@ jobs:
run: rustup show
- uses: mozilla-actions/[email protected]
- run: make venv
- run: .venv/bin/python -m pip install polars==1.5.0 # min version
- run: .venv/bin/python -m pip install polars==1.3.0 # min version
- run: make install
- run: make test

linux:
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x86_64]
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
name: wheels-linux-${{ matrix.platform.target }}
path: dist

windows:
runs-on: windows-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x64, x86]
platform:
- runner: windows-latest
target: x64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
python-version: 3.x
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.target }}
name: wheels-windows-${{ matrix.platform.target }}
path: dist

macos:
runs-on: macos-latest
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
target: [x86_64, aarch64]
platform:
- runner: macos-13
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
target: ${{ matrix.platform.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}
name: wheels-macos-${{ matrix.platform.target }}
path: dist

sdist:
Expand All @@ -157,11 +169,23 @@ jobs:
needs: [linux, windows, macos, sdist]
environment: pypi
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: 'wheels-*/*'
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "polars_xdt"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21.2", features = ["extension-module", "abi3-py38"] }
pyo3 = { version = "0.21.2", features = ["extension-module", "abi3-py39"] }
pyo3-polars = { version = "0.18.0", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
chrono = { version = "0.4.38", default-features = false, features = ["std", "unstable-locales"] }
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
requires-python = ">=3.8"
requires-python = ">=3.9"

[project.urls]
"Repository" = "https://github.com/MarcoGorelli/polars-xdt"
Expand Down

0 comments on commit f391da9

Please sign in to comment.