Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update workflows #87

Merged
merged 8 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 55 additions & 31 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 @@ -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:
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.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion polars_xdt/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion polars_xdt/ranges.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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

mapping = {"Mon": 1, "Tue": 2, "Wed": 3, "Thu": 4, "Fri": 5, "Sat": 6, "Sun": 7}

if TYPE_CHECKING:
import sys
from collections.abc import Sequence

if sys.version_info >= (3, 10):
from typing import TypeAlias
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
Loading