Skip to content

ci: add graalpy #1090

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

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
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
41 changes: 23 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
🐍 ${{ matrix.python-version }} • CMake ${{ matrix.cmake-version }} on ${{
matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -90,10 +89,9 @@ jobs:
- python-version: "3.12"
runs-on: windows-latest
cmake-version: "3.26.x"
# TODO: CMake doesn't work with beta 1 on Windows
# - python-version: "3.14"
# runs-on: windows-latest
# cmake-version: "4.0.x"
- python-version: "3.14"
runs-on: windows-latest
cmake-version: "4.0.x"
- python-version: "3.13"
runs-on: windows-latest
cmake-version: "3.26.x"
Expand All @@ -106,6 +104,14 @@ jobs:
- python-version: "3.12"
runs-on: windows-11-arm
cmake-version: "4.0"
- python-version: "graalpy-24.2"
runs-on: ubuntu-latest
cmake-version: "4.0"
exclude:
# No NumPy PyPy for ARM
- python-version: "pypy-3.10"
runs-on: macos-14
cmake-version: "3.15.x"

steps:
- uses: actions/checkout@v4
Expand All @@ -125,33 +131,32 @@ jobs:
run:
uv pip install
-e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools]
--system
--system --only-binary=numpy
--extra-index-url=https://www.graalvm.org/python/wheels/
--index-strategy=unsafe-best-match

- name: Install package (pip)
if: matrix.python-version == 'pypy-3.8'
run:
pip install
-e.[test,test-meta,test-numpy,test-schema,wheels,cov,wheel-free-setuptools]

- name: Test package (serial)
if: "contains(matrix.python-version, 'graalpy')"
run: pytest -ra -v --showlocals --durations=20
env:
PIP_ONLY_BINARY: numpy
PIP_EXTRA_INDEX_URL: https://www.graalvm.org/python/wheels/

- name: Test package
if: "!contains(matrix.python_version, 'pypy')"
if: "!contains(matrix.python-version, 'graalpy')"
run: >-
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n
auto --durations=20

- name: Test package (two attempts)
uses: nick-fields/retry@v3
if: "contains(matrix.python_version, 'pypy')"
with:
max_attempts: 2
retry_on: error
timeout_seconds: 5
command: >-
pytest -ra --showlocals --cov --cov-report=xml --cov-report=term
--durations=20 -n auto

- name: Upload coverage report
uses: codecov/codecov-action@v5
if: "!contains(matrix.python-version, 'graalpy')"
with:
name:
${{ runner.os }}-${{ matrix.python-version }}-${{
Expand Down
24 changes: 20 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ test-meta = [
"setuptools-scm",
]
test-numpy = [
"numpy; python_version<'3.14' and platform_python_implementation!='PyPy' and (platform_system != 'Windows' or platform_machine != 'ARM64')",
"numpy~=1.24.0; python_version=='3.8' and platform_python_implementation=='PyPy'",
"numpy~=2.0.0; python_version=='3.9' and platform_python_implementation=='PyPy'",
"numpy~=2.2.0; python_version=='3.10' and platform_python_implementation=='PyPy'",
"numpy; python_version<'3.14' and implementation_name!='pypy' and implementation_name!='graalpy' and (platform_system != 'Windows' or platform_machine != 'ARM64')",
"numpy~=1.24.0; python_version=='3.8' and implementation_name=='pypy'",
"numpy~=2.0.0; python_version=='3.9' and implementation_name=='pypy'",
"numpy~=2.2.0; python_version=='3.10' and implementation_name=='pypy'",
"numpy==1.26.4; python_version=='3.11' and implementation_name=='graalpy' and platform_system != 'Darwin'",
]
test-schema = [
"fastjsonschema",
Expand Down Expand Up @@ -133,6 +134,21 @@ dev-dependencies = ["scikit-build-core[test,test-hatchling,test-meta,test-numpy,
workspace.members = ["tmp/hello/hello"]


[tool.uv.sources]
numpy = [
{ index = "graalpy", marker = "implementation_name == 'graalpy'"},
{ index = "pypi", marker = "implementation_name != 'graalpy'"},
]

[[tool.uv.index]]
name = "graalpy"
url = "https://www.graalvm.org/python/wheels/"

[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple"


[tool.pytest.ini_options]
minversion = "7.2"
addopts = ["-ra", "--strict-markers", "--strict-config"]
Expand Down
Loading