diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 332e735..fb66d05 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 @@ -68,71 +70,81 @@ jobs: - 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.lock b/Cargo.lock index f100513..ceb570d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "polars_xdt" -version = "0.16.1" +version = "0.16.6" dependencies = [ "chrono", "chrono-tz 0.10.0", diff --git a/Cargo.toml b/Cargo.toml index 4730b41..df71231 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.16.2" +version = "0.16.7" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -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/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 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"