Skip to content
Draft
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
62 changes: 62 additions & 0 deletions .github/workflows/ci-graalpy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI (GraalPy)

# GraalPy is slow (a serial test run takes ~35 min) and is therefore opt-in:
# the job only runs on PRs carrying the "graalpy" label. `labeled` lets adding
# the label start it without a new push; `synchronize` reruns it on later pushes
# to an already-labeled PR. Keeping it in its own workflow means toggling labels
# does not retrigger the main CI workflow.
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, labeled]

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

env:
FORCE_COLOR: 3

permissions: {}

jobs:
graalpy:
name: 🐍 GraalPy 25.0 • CMake 4.0 on ubuntu-latest
runs-on: ubuntu-latest
if:
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'graalpy')
timeout-minutes: 90

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "graalpy-25.0"
allow-prereleases: true

- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0

- name: Setup CMake 4.0
uses: jwlawson/actions-setup-cmake@0d6a7d60b009d01c9e7523be22153ff8f19460d3 # v2.2.0
with:
cmake-version: "4.0"

- name: Install package (uv)
# --no-config bypasses [tool.uv].exclude-newer, which otherwise filters
# out the date-less numpy wheels served by the GraalVM index.
run:
uv pip install --no-config -e.[wheels,wheel-free-setuptools]
--group=dev --system --only-binary=numpy
--extra-index-url=https://www.graalvm.org/python/wheels/
--index-strategy=unsafe-best-match

- name: Test package (serial)
# GraalPy is too slow for xdist here; run serially.
run: pytest -ra -v --showlocals --durations=20
env:
PIP_ONLY_BINARY: numpy
PIP_EXTRA_INDEX_URL: https://www.graalvm.org/python/wheels/
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ test-meta = [
]
test-numpy = [
{ include-group = "test-core" },
"numpy>=1.24.1; python_version<'3.15' and platform_python_implementation!='PyPy' and (platform_system != 'Windows' or platform_machine != 'ARM64')",
"numpy>=1.24.1; python_version<'3.15' and platform_python_implementation!='PyPy' and implementation_name!='graalpy' and (platform_system != 'Windows' or platform_machine != 'ARM64')",
"numpy~=1.24.1; python_version=='3.8' and platform_python_implementation=='PyPy'",
"numpy~=2.0; python_version=='3.9' and platform_python_implementation=='PyPy'",
"numpy~=2.2; python_version=='3.10' and platform_python_implementation=='PyPy'",
"numpy~=2.4.1; python_version=='3.11' and platform_python_implementation=='PyPy'",
"numpy==2.2.4; python_version=='3.12' and implementation_name=='graalpy' and platform_system != 'Darwin'",
]
test-pybind11 = [
{ include-group = "test-core" },
Expand Down
4 changes: 3 additions & 1 deletion tests/test_editable_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ def test_is_module():
)
def test_is_module_rejects_versioned_sonames():
assert is_module(Path("tango/_tango.so"))
assert is_module(Path("tango/_tango.abi3.so"))
if ".abi3.so" in importlib.machinery.EXTENSION_SUFFIXES:
# GraalPy and other non-CPython interpreters may not support abi3.
assert is_module(Path("tango/_tango.abi3.so"))

# Versioned sonames are not importable (PEP 3149); they alias the real
# _tango.so and must not resolve as the module (issue #1144).
Expand Down
5 changes: 5 additions & 0 deletions tests/test_fortran.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import shutil
import sys
import sysconfig
import zipfile
from pathlib import Path
Expand Down Expand Up @@ -38,6 +39,10 @@
@pytest.mark.skipif(
ninja_info is None, reason="Ninja needs to be 1.10+ to support Fortran with CMake"
)
@pytest.mark.skipif(
sys.implementation.name == "graalpy",
reason="GraalPy segfaults calling a Fortran extension through numpy",
)
def test_pep517_wheel(tmp_path, monkeypatch, virtualenv):
dist = tmp_path / "dist"
monkeypatch.chdir(FORTRAN_EXAMPLE)
Expand Down
Loading