From a1ca267e8e0fd3f37a702186efd38fc4b199499e Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 01:32:10 -0400 Subject: [PATCH 01/12] ci: add graalpy Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 904ebff4..395df639 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,9 +91,9 @@ jobs: 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" @@ -106,6 +106,9 @@ 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" steps: - uses: actions/checkout@v4 From 69ee7002a82c953c3a692f552221b2fba0102cba Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 02:29:22 -0400 Subject: [PATCH 02/12] ci: linear graalpy tests Signed-off-by: Henry Schreiner style: pre-commit fixes --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 395df639..c2430243 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: -e.[test,test-meta,test-numpy,test-schema,wheels,cov,wheel-free-setuptools] - name: Test package - if: "!contains(matrix.python_version, 'pypy')" + if: "!contains(matrix.python_version, 'py')" run: >- pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n auto --durations=20 @@ -153,6 +153,12 @@ jobs: pytest -ra --showlocals --cov --cov-report=xml --cov-report=term --durations=20 -n auto + - name: Test package (serial) + if: "contains(matrix.python_version, 'graalpy')" + run: >- + pytest -ra --showlocals --cov --cov-report=xml --cov-report=term + --durations=20 + - name: Upload coverage report uses: codecov/codecov-action@v5 with: From 4840559a1f39d6b504f266370cb42e71e34e7030 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 02:39:55 -0400 Subject: [PATCH 03/12] fix: pull binary numpy for graalpy Signed-off-by: Henry Schreiner style: pre-commit fixes --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2430243..b0e0f75f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,7 +128,9 @@ 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/simple + --index-strategy=unsafe-best-match - name: Install package (pip) if: matrix.python-version == 'pypy-3.8' From 92bf4d76235bb9c28ce325195b63d91fe82755a1 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 03:36:12 -0400 Subject: [PATCH 04/12] tests: flip order style: pre-commit fixes --- .github/workflows/ci.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0e0f75f..ed30f0ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,9 +128,10 @@ jobs: run: uv pip install -e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools] - --system --only-binary=numpy - --extra-index-url=https://www.graalvm.org/python/wheels/simple - --index-strategy=unsafe-best-match + --system + # --only-binary=numpy + # --extra-index-url=https://www.graalvm.org/python/wheels/simple + # --index-strategy=unsafe-best-match - name: Install package (pip) if: matrix.python-version == 'pypy-3.8' @@ -138,12 +139,6 @@ jobs: pip install -e.[test,test-meta,test-numpy,test-schema,wheels,cov,wheel-free-setuptools] - - name: Test package - if: "!contains(matrix.python_version, 'py')" - 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')" @@ -161,6 +156,12 @@ jobs: pytest -ra --showlocals --cov --cov-report=xml --cov-report=term --durations=20 + - name: Test package + if: "!contains(matrix.python_version, 'py')" + run: >- + pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n + auto --durations=20 + - name: Upload coverage report uses: codecov/codecov-action@v5 with: From bb1eaaaea98eaa6bfb305e128ca301d8f0890504 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 03:58:18 -0400 Subject: [PATCH 05/12] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed30f0ee..de1f1f8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,7 +141,7 @@ jobs: - name: Test package (two attempts) uses: nick-fields/retry@v3 - if: "contains(matrix.python_version, 'pypy')" + if: "contains(matrix.python-version, 'pypy')" with: max_attempts: 2 retry_on: error @@ -151,13 +151,13 @@ jobs: --durations=20 -n auto - name: Test package (serial) - if: "contains(matrix.python_version, 'graalpy')" + if: "contains(matrix.python-version, 'graalpy')" run: >- pytest -ra --showlocals --cov --cov-report=xml --cov-report=term --durations=20 - name: Test package - if: "!contains(matrix.python_version, 'py')" + if: "!contains(matrix.python-version, 'py')" run: >- pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n auto --durations=20 From 6a345aa40981752100e1bbedd2ad4fe962c38ebe Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 11:00:33 -0400 Subject: [PATCH 06/12] ci: drop coverage to see if we can get GraalPy working Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de1f1f8d..f9d7978f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,16 +145,13 @@ jobs: 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: Test package (serial) if: "contains(matrix.python-version, 'graalpy')" - run: >- - pytest -ra --showlocals --cov --cov-report=xml --cov-report=term - --durations=20 + run: pytest -ra --showlocals --durations=20 - name: Test package if: "!contains(matrix.python-version, 'py')" From 7f0ca74e30b462131fc2702809fd75e404226b94 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 11:30:19 -0400 Subject: [PATCH 07/12] ci: download numpy Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9d7978f..ff96e0db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,10 +128,9 @@ jobs: run: uv pip install -e.[test,test-meta,test-numpy,test-schema,test-hatchling,wheels,cov,wheel-free-setuptools] - --system - # --only-binary=numpy - # --extra-index-url=https://www.graalvm.org/python/wheels/simple - # --index-strategy=unsafe-best-match + --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' @@ -139,22 +138,12 @@ jobs: pip install -e.[test,test-meta,test-numpy,test-schema,wheels,cov,wheel-free-setuptools] - - name: Test package (two attempts) - uses: nick-fields/retry@v3 - if: "contains(matrix.python-version, 'pypy')" - with: - max_attempts: 2 - retry_on: error - command: >- - pytest -ra --showlocals --cov --cov-report=xml --cov-report=term - --durations=20 -n auto - - name: Test package (serial) if: "contains(matrix.python-version, 'graalpy')" run: pytest -ra --showlocals --durations=20 - name: Test package - if: "!contains(matrix.python-version, 'py')" + if: "!contains(matrix.python-version, 'graalpy')" run: >- pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n auto --durations=20 From 14e57ea5c1ce2b283966b9c93c5e63f797511b9c Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 12:23:12 -0400 Subject: [PATCH 08/12] ci: longer timeout, restore parallel for graalpy Signed-off-by: Henry Schreiner style: pre-commit fixes --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff96e0db..d63e73f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: 🐍 ${{ matrix.python-version }} • CMake ${{ matrix.cmake-version }} on ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }} - timeout-minutes: 40 + timeout-minutes: 70 strategy: fail-fast: false matrix: @@ -90,7 +90,6 @@ 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" @@ -109,6 +108,11 @@ jobs: - 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 @@ -138,12 +142,12 @@ jobs: 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 --showlocals --durations=20 + #- name: Test package (serial) + # if: "contains(matrix.python-version, 'graalpy')" + # run: pytest -ra --showlocals --durations=20 - name: Test package - if: "!contains(matrix.python-version, 'graalpy')" + # if: "!contains(matrix.python-version, 'graalpy')" run: >- pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n auto --durations=20 From d7190716814fcf17dd66769433e949a5c68aacc6 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 14:17:18 -0400 Subject: [PATCH 09/12] Update ci.yml --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d63e73f2..40c7a5c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,6 @@ jobs: 🐍 ${{ matrix.python-version }} • CMake ${{ matrix.cmake-version }} on ${{ matrix.runs-on }} runs-on: ${{ matrix.runs-on }} - timeout-minutes: 70 strategy: fail-fast: false matrix: @@ -142,12 +141,12 @@ jobs: 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 --showlocals --durations=20 + - name: Test package (serial) + if: "contains(matrix.python-version, 'graalpy')" + run: pytest -ra -v --showlocals --durations=20 - name: Test package - # if: "!contains(matrix.python-version, 'graalpy')" + if: "!contains(matrix.python-version, 'graalpy')" run: >- pytest -ra --showlocals --cov --cov-report=xml --cov-report=term -n auto --durations=20 From f67be847af0e1f3eb117f00a33b57f4cbdf5a001 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 23:28:10 -0400 Subject: [PATCH 10/12] ci: make sure we download binary of numpy in tests Signed-off-by: Henry Schreiner --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40c7a5c7..b262b131 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,6 +144,10 @@ jobs: - 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, 'graalpy')" @@ -153,6 +157,7 @@ jobs: - name: Upload coverage report uses: codecov/codecov-action@v5 + if: "!contains(matrix.python-version, 'graalpy')" with: name: ${{ runner.os }}-${{ matrix.python-version }}-${{ From f937f305c48b8cb3ce89239301b77ed9632c25bd Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 31 May 2025 23:31:22 -0400 Subject: [PATCH 11/12] fix: commandFragments is optional Signed-off-by: Henry Schreiner style: pre-commit fixes --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b262b131..500f8a94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,7 +148,6 @@ jobs: PIP_ONLY_BINARY: numpy PIP_EXTRA_INDEX_URL: https://www.graalvm.org/python/wheels/ - - name: Test package if: "!contains(matrix.python-version, 'graalpy')" run: >- From e035baecaf89bdaad18568468dcee45bc68ec8d1 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sun, 1 Jun 2025 01:25:52 -0400 Subject: [PATCH 12/12] chore: make local runs a bit easier Signed-off-by: Henry Schreiner --- pyproject.toml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6542b72f..3089b075 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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"]