Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
073c656
Update maturin_upload_pypi.yml
AngheloAlf Jan 9, 2026
02cc5d2
Add --find-interpreter to linux to try to fix ci
AngheloAlf Jan 9, 2026
b9dc092
Check wheels are installable in older python versions in CI
AngheloAlf Jan 9, 2026
537d100
fix, hopefully
AngheloAlf Jan 9, 2026
8977da6
whoops
AngheloAlf Jan 9, 2026
4a8e853
bleh
AngheloAlf Jan 9, 2026
f9e619f
testing
AngheloAlf Jan 10, 2026
4ca364e
bruh
AngheloAlf Jan 10, 2026
976615c
print2
AngheloAlf Jan 10, 2026
67b8b07
change order of flags
AngheloAlf Jan 10, 2026
c9d93a4
more stuff
AngheloAlf Jan 10, 2026
b089696
???
AngheloAlf Jan 10, 2026
7cda093
¿¿¿
AngheloAlf Jan 10, 2026
ec35ef5
'''''
AngheloAlf Jan 10, 2026
d98136c
maybe this could work?
AngheloAlf Jan 10, 2026
18fe3f9
fix check
AngheloAlf Jan 10, 2026
ab271b6
do no test on musllinux and try to fix macos and windows
AngheloAlf Jan 10, 2026
051a963
Fix find command on windows and try to fix macos again
AngheloAlf Jan 10, 2026
941f48e
version
AngheloAlf Jan 10, 2026
972e12f
a
AngheloAlf Jan 10, 2026
dfad07a
silly yaml
AngheloAlf Jan 10, 2026
97639e4
3.11
AngheloAlf Jan 10, 2026
1f06da2
windows arm sillines
AngheloAlf Jan 10, 2026
e55efdf
only check x64 windows builds
AngheloAlf Jan 10, 2026
9952592
typo
AngheloAlf Jan 10, 2026
f6b0a34
Be explicit about minimal version
AngheloAlf Jan 10, 2026
a73863d
More version tweaking and try to fix linux again
AngheloAlf Jan 10, 2026
8296fe4
maybe?
AngheloAlf Jan 10, 2026
4811464
maybe now
AngheloAlf Jan 10, 2026
27bed70
Go to 3.7 because that's the minimal version supported by pyo3
AngheloAlf Jan 10, 2026
dac8f43
Windows is being silly and doesnt want to play nice
AngheloAlf Jan 10, 2026
6598c0f
Windows really doesn't want to cooperate
AngheloAlf Jan 10, 2026
f7583af
version bump
AngheloAlf Jan 10, 2026
c311e3c
Try to add support for pypy again
AngheloAlf Jan 10, 2026
3072fa9
more pypy
AngheloAlf Jan 10, 2026
229591f
Use backward slashes for windows
AngheloAlf Jan 10, 2026
3e49bd0
Force gil version for the max version python check
AngheloAlf Jan 10, 2026
6635c29
Use `--no-managed-python` instead of `+gil`
AngheloAlf Jan 10, 2026
80d796b
Maybe I want `--managed-python`
AngheloAlf Jan 10, 2026
e850d24
Test pypy linux wheels
AngheloAlf Jan 11, 2026
b83624a
fix
AngheloAlf Jan 11, 2026
67db660
more fixes
AngheloAlf Jan 11, 2026
9793b97
use the script in macos
AngheloAlf Jan 11, 2026
e2d20a1
test free threaded and pypy wheels in windows
AngheloAlf Jan 11, 2026
6351572
fix
AngheloAlf Jan 11, 2026
a79ef37
maybe?
AngheloAlf Jan 11, 2026
6e604e0
????
AngheloAlf Jan 11, 2026
a58a791
another test
AngheloAlf Jan 11, 2026
d52e0d1
hopefully fix this, for real this time
AngheloAlf Jan 11, 2026
9216b24
Remove pypy builds from windows
AngheloAlf Jan 11, 2026
bc1c870
more fix
AngheloAlf Jan 11, 2026
5d09037
maybe
AngheloAlf Jan 11, 2026
e4e5c47
comments
AngheloAlf Jan 11, 2026
02ce3cd
cleanup
AngheloAlf Jan 11, 2026
bba518e
whoops
AngheloAlf Jan 11, 2026
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
34 changes: 34 additions & 0 deletions .github/scripts/ci_check_wheel.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# A Powershell port of `ci_check_wheel.sh`. Refer to that script instead.

# Any change made here should be made in `ci_check_wheel.sh` too.

param (
[Parameter(Mandatory = $true)]
[string]$PYTHON_VERSION,

[Parameter(Mandatory = $true)]
[string]$KEY,

[string]$EXTRA
)

# Equivalent to `set -e`
$ErrorActionPreference = "Stop"

if (Test-Path ".venv") {
Remove-Item -Recurse -Force ".venv"
}

# When $EXTRA is empty powershell passes the argument as an empty argument to
# uv, so we need to explicitly check the argument and only pass it if it is not
# empty to avoid uv from erroring
if ($EXTRA) {
uv venv .venv -p $PYTHON_VERSION $EXTRA
} else {
uv venv .venv -p $PYTHON_VERSION
}

.\.venv\Scripts\Activate.ps1
uv run python --version
uv pip install $(Get-ChildItem -Path .\dist\ -Recurse -Filter "crunch64-*-abi3-*")
uv run python -c "import crunch64; print(crunch64.__version__)"
33 changes: 33 additions & 0 deletions .github/scripts/ci_check_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This script checks a given Python wheel inside the `dist` is installable in a
# given Python version.
#
# It recieves the following arguments:
# - The python version to check, it must be compatible with uv.
# - A key value to allow searching for the wheel in the `dist` folder. Only a
# single wheel in the folder must contain this value in its name.
# Recommended values: abi3, cp314t, pypy39 and similar values.
# - (OPTIONAL) A single aditional flag to pass to `uv venv`.
# Usually `--managed-python`.

# Any change made here should be made in `ci_check_wheel.ps1` too.

PYTHON_VERSION=$1
KEY=$2
EXTRA=$3

# Exit with an error value if any command produces an error.
set -e

# We make a venv with the Python version we were told to.
rm -rf .venv
uv venv -p $PYTHON_VERSION $EXTRA
source .venv/bin/activate
# Allows us to check we are actually using the requested Python version.
uv run python --version

# We install the wheel by looking it up in the dist folder.
# We need to do a `find` command here because we don't know the exact name of
# the wheel (it can be affected by package version, arch, python version, etc.).
uv pip install $(find ./dist/ -name "crunch64-*-$KEY*")
# Check something basic to make sure it was installed correctly.
uv run python -c "import crunch64; print(crunch64.__version__)"
169 changes: 130 additions & 39 deletions .github/workflows/maturin_upload_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is autogenerated by maturin v1.9.6
# This file is autogenerated by maturin v1.11.4
# To update, run
#
# maturin generate-ci github
Expand All @@ -13,42 +13,55 @@ on:
permissions:
contents: read

# At the time of writing, PyO3 has a hard minimal Python version of 3.7, so
# there's no use trying to go any lower than that.

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
python_version_min: '3.7'
python_version_max: '3.14'
- runner: ubuntu-22.04
target: x86
python_version_min: '3.7'
python_version_max: '3.14'
- runner: ubuntu-22.04
target: aarch64
python_version_min: '3.7'
python_version_max: '3.14'
- runner: ubuntu-22.04
target: armv7
python_version_min: '3.7'
python_version_max: '3.14'
- runner: ubuntu-22.04
target: s390x
python_version_min: '3.7'
python_version_max: '3.14'
- runner: ubuntu-22.04
target: ppc64le
python_version_min: '3.7'
python_version_max: '3.14'
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v6
with:
python-version: |
3.8 - 3.14
3.x
pypy3.8
${{ matrix.platform.python_version_min }}
3.14t
pypy3.9
pypy3.10
pypy3.11
- name: Build wheels
uses: PyO3/maturin-action@v1
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
with:
target: ${{ matrix.platform.target }}
args: --release --out ../dist --find-interpreter
args: --release --out ../dist -i python${{ matrix.platform.python_version_min }} python3.14t pypy3.9 pypy3.10 pypy3.11
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: auto
working-directory: lib/
Expand All @@ -59,37 +72,72 @@ jobs:
path: dist
if-no-files-found: error

# Test the built wheels are installable in the min and max Python
# versions we are about.
# We do this by installing the Python version in a venv using uv,
# installing the built wheel into the venv and running some simple
# command like printing the crunch64 version from within Python.
# We can only test the wheels that matches the architecture of the runner
# so we hope the other built wheels will just work, hopefully.
- name: Install uv
uses: astral-sh/setup-uv@v7
if: ${{ matrix.platform.target == 'x86_64' }}
- name: Test wheels with min version (${{ matrix.platform.python_version_min }})
if: ${{ matrix.platform.target == 'x86_64' }}
# Check the built wheel is installable on the oldest Python supported
run: |
.github/scripts/ci_check_wheel.sh ${{ matrix.platform.python_version_min }} abi3
- name: Test wheels with max version (${{ matrix.platform.python_version_max }})
if: ${{ matrix.platform.target == 'x86_64' }}
# Check the built wheel is installable on the newest Python we know of
run: |
.github/scripts/ci_check_wheel.sh ${{ matrix.platform.python_version_max }} abi3 --managed-python

- name: Test free threaded wheels
if: ${{ matrix.platform.target == 'x86_64' }}
run: |
.github/scripts/ci_check_wheel.sh 3.14t cp314t --managed-python

- name: Test pypy wheels
if: ${{ matrix.platform.target == 'x86_64' }}
run: |
.github/scripts/ci_check_wheel.sh pypy3.9 pypy39 --managed-python
.github/scripts/ci_check_wheel.sh pypy3.10 pypy310 --managed-python
.github/scripts/ci_check_wheel.sh pypy3.11 pypy311 --managed-python

musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
python_version_min: '3.7'
- runner: ubuntu-22.04
target: x86
python_version_min: '3.7'
- runner: ubuntu-22.04
target: aarch64
python_version_min: '3.7'
- runner: ubuntu-22.04
target: armv7
python_version_min: '3.7'
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v6
with:
python-version: |
3.8 - 3.14
3.x
pypy3.8
${{ matrix.platform.python_version_min }}
3.14t
pypy3.9
pypy3.10
pypy3.11
- name: Build wheels
uses: PyO3/maturin-action@v1
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
with:
target: ${{ matrix.platform.target }}
args: --release --out ../dist --find-interpreter
args: --release --out ../dist -i python${{ matrix.platform.python_version_min }} python3.14t pypy3.9 pypy3.10 pypy3.11
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
working-directory: lib/
Expand All @@ -100,33 +148,42 @@ jobs:
path: dist
if-no-files-found: error

# We can't test musllinux wheels on manylinux runners

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: windows-latest
target: x64
python_arch: x64
python_version_min: '3.7'
python_version_max: '3.14'
- runner: windows-latest
target: x86
python_arch: x86
python_version_min: '3.7'
python_version_max: '3.14'
- runner: windows-11-arm
target: aarch64
python_arch: arm64
python_version_min: '3.11'
python_version_max: '3.14'
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v6
with:
# We can't use pypy3.8 nor pypy3.11 in CI
python-version: |
3.8 - 3.14
3.x
pypy3.9
pypy3.10
architecture: ${{ matrix.platform.target }}
${{ matrix.platform.python_version_min }}
3.14t
architecture: ${{ matrix.platform.python_arch }}
- name: Build wheels
uses: PyO3/maturin-action@v1
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
with:
target: ${{ matrix.platform.target }}
args: --release --out ../dist --find-interpreter
args: --release --out ../dist -i python${{ matrix.platform.python_version_min }} python3.14t
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
working-directory: lib/
- name: Upload wheels
Expand All @@ -136,33 +193,47 @@ jobs:
path: dist
if-no-files-found: error

- name: Install uvci_check_wheel
uses: astral-sh/setup-uv@v7
- name: Test wheels with min version (${{ matrix.platform.python_version_min }})
if: ${{ matrix.platform.target == 'x64' }}
# Check the built wheel is installable on the oldest Python supported
run: |
.github/scripts/ci_check_wheel.ps1 ${{ matrix.platform.python_version_min }} abi3
- name: Test wheels with max version (${{ matrix.platform.python_version_max }})
if: ${{ matrix.platform.target == 'x64' }}
run: |
.github/scripts/ci_check_wheel.ps1 ${{ matrix.platform.python_version_max }} abi3 --managed-python

macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: macos-15-intel
target: x86_64
- runner: macos-14
python_version_min: '3.7'
python_version_max: '3.14'
- runner: macos-latest
target: aarch64
python_version_min: '3.8'
python_version_max: '3.14'
steps:
- uses: actions/checkout@main
- uses: actions/setup-python@v6
with:
# We can't use pypy3.8 in CI
python-version: |
3.8 - 3.14
3.x
${{ matrix.platform.python_version_min }}
3.14t
pypy3.9
pypy3.10
pypy3.11
- name: Build wheels
uses: PyO3/maturin-action@v1
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
with:
target: ${{ matrix.platform.target }}
args: --release --out ../dist --find-interpreter
args: --release --out ../dist -i python${{ matrix.platform.python_version_min }} python3.14t pypy3.9 pypy3.10 pypy3.11
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
working-directory: lib/
- name: Upload wheels
Expand All @@ -172,14 +243,33 @@ jobs:
path: dist
if-no-files-found: error

- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Test wheels with min version (${{ matrix.platform.python_version_min }})
# Check the built wheel is installable on the oldest Python supported
run: |
.github/scripts/ci_check_wheel.sh ${{ matrix.platform.python_version_min }} abi3
- name: Test wheels with max version (${{ matrix.platform.python_version_max }})
# Check the built wheel is installable on the oldest Python supported
run: |
.github/scripts/ci_check_wheel.sh ${{ matrix.platform.python_version_max }} abi3 --managed-python

- name: Test free threaded wheels
run: |
.github/scripts/ci_check_wheel.sh 3.14t cp314t --managed-python

- name: Test pypy wheels
run: |
.github/scripts/ci_check_wheel.sh pypy3.9 pypy39 --managed-python
.github/scripts/ci_check_wheel.sh pypy3.10 pypy310 --managed-python
.github/scripts/ci_check_wheel.sh pypy3.11 pypy311 --managed-python

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Build sdist
uses: PyO3/maturin-action@v1
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
with:
command: sdist
args: --out ../dist
Expand Down Expand Up @@ -223,17 +313,18 @@ jobs:
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v6
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
uses: actions/attest-build-provenance@v3
with:
subject-path: 'wheels-*/*'
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Publish to PyPI (dry-run)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: uv publish 'wheels-*/*' --dry-run
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: PyO3/maturin-action@v1
run: uv publish 'wheels-*/*'
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }}
3 changes: 2 additions & 1 deletion .github/workflows/python_bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on: [push, pull_request]
jobs:
tests_cases:
name: Test for Python ${{ matrix.py_version }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
py_version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand Down
Loading
Loading