From f391da95e497b520c81cc7690a1adee6dfcf6aca Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:42:58 +0000 Subject: [PATCH 1/8] update workflows --- .github/workflows/CI.yml | 88 +++++++++++++++++++++++++--------------- Cargo.toml | 2 +- pyproject.toml | 2 +- 3 files changed, 58 insertions(+), 34 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 332e735..ee6e05f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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: @@ -15,10 +21,6 @@ on: pull_request: workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - permissions: contents: read @@ -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 @@ -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 @@ -63,76 +65,86 @@ jobs: run: rustup show - uses: mozilla-actions/sccache-action@v0.0.6 - 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: @@ -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-*/* diff --git a/Cargo.toml b/Cargo.toml index 4730b41..704573a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/pyproject.toml b/pyproject.toml index fb120ee..47a76d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" From c789525d63aaaa1feab8d9bfadb8c8eb941a4f73 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:44:06 +0000 Subject: [PATCH 2/8] Bump version to 0.16.3 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f100513..981a70d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "polars_xdt" -version = "0.16.1" +version = "0.16.2" dependencies = [ "chrono", "chrono-tz 0.10.0", diff --git a/Cargo.toml b/Cargo.toml index 704573a..5d848b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.16.2" +version = "0.16.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 5b099159a3a6e18185e4c4ac40340f961c5f25d4 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:45:12 +0000 Subject: [PATCH 3/8] fix min version --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ee6e05f..fb66d05 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -65,7 +65,7 @@ jobs: run: rustup show - uses: mozilla-actions/sccache-action@v0.0.6 - run: make venv - - run: .venv/bin/python -m pip install polars==1.3.0 # min version + - run: .venv/bin/python -m pip install polars==1.5.0 # min version - run: make install - run: make test From 7d6c43115afc0e387597e951fa7c65fa25846159 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:45:26 +0000 Subject: [PATCH 4/8] Bump version to 0.16.4 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 981a70d..15cbcd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "polars_xdt" -version = "0.16.2" +version = "0.16.3" dependencies = [ "chrono", "chrono-tz 0.10.0", diff --git a/Cargo.toml b/Cargo.toml index 5d848b7..799fd0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.16.3" +version = "0.16.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 376eb05f235f13788f5112eef105b4485cb94f94 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:51:43 +0000 Subject: [PATCH 5/8] lint --- Cargo.lock | 2 +- polars_xdt/functions.py | 3 ++- polars_xdt/ranges.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15cbcd7..2b3c8f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "polars_xdt" -version = "0.16.3" +version = "0.16.4" dependencies = [ "chrono", "chrono-tz 0.10.0", diff --git a/polars_xdt/functions.py b/polars_xdt/functions.py index bb22aea..1589313 100644 --- a/polars_xdt/functions.py +++ b/polars_xdt/functions.py @@ -2,7 +2,7 @@ import sys from pathlib import Path -from typing import TYPE_CHECKING, Literal, Sequence +from typing import TYPE_CHECKING, Literal import polars as pl from polars.plugins import register_plugin_function @@ -15,6 +15,7 @@ from typing_extensions import TypeAlias if TYPE_CHECKING: + from collections.abc import Sequence from datetime import date from polars import Expr diff --git a/polars_xdt/ranges.py b/polars_xdt/ranges.py index 5b683ff..7a0e803 100644 --- a/polars_xdt/ranges.py +++ b/polars_xdt/ranges.py @@ -1,7 +1,7 @@ from __future__ import annotations import re -from typing import TYPE_CHECKING, Literal, Sequence, Union, overload +from typing import TYPE_CHECKING, Literal, Union, overload import polars as pl @@ -9,6 +9,7 @@ if TYPE_CHECKING: import sys + from collections.abc import Sequence if sys.version_info >= (3, 10): from typing import TypeAlias From 20072d0d12f1b56821359311d6dcbbfaea8b3fb9 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:52:07 +0000 Subject: [PATCH 6/8] Bump version to 0.16.5 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 799fd0e..3a0ffe5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.16.4" +version = "0.16.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 74932e2db36e84973dcf1cc502e737f869c25523 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:01:56 +0000 Subject: [PATCH 7/8] Bump version to 0.16.6 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b3c8f4..ffa73d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "polars_xdt" -version = "0.16.4" +version = "0.16.5" dependencies = [ "chrono", "chrono-tz 0.10.0", diff --git a/Cargo.toml b/Cargo.toml index 3a0ffe5..6aebe1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.16.5" +version = "0.16.6" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 1eb477a7a5e9631427c6f275a9228a0cc6d480a4 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:15:16 +0000 Subject: [PATCH 8/8] Bump version to 0.16.7 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ffa73d2..ceb570d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "polars_xdt" -version = "0.16.5" +version = "0.16.6" dependencies = [ "chrono", "chrono-tz 0.10.0", diff --git a/Cargo.toml b/Cargo.toml index 6aebe1a..df71231 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.16.6" +version = "0.16.7" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html