feat: support GraalPy (#1538)

* Properly close files used for testing

* Add support for GraalPy

* Help GraalPy discover build tools on Windows

* Expect manylinux-interpreters ensure graalpy* warning in pip

* Workaround GraalPy bugs on Windows

* Workaround oracle/graalpython#491 also when uv is not available

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update azure-pipelines.yml

* Update azure-pipelines.yml

* refacotor: use pathlib.write_text

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Include GraalPy in docker_warmup and remove workaround for installing it late

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
This commit is contained in:
Tim Felgentreff
2025-04-28 18:25:17 -04:00
committed by GitHub
co-authored by pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Henry Schreiner
parent 5f8d06ff55
commit 020a91baa8
22 changed files with 287 additions and 38 deletions
+15 -5
View File
@@ -81,7 +81,9 @@ def test(tmp_path):
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} ./test",
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || pytest ./test",
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
# until https://github.com/oracle/graalpython/issues/490 is fixed
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest ./test",
},
)
@@ -102,7 +104,9 @@ def test_extras_require(tmp_path):
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} ./test",
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || pytest ./test",
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
# until https://github.com/oracle/graalpython/issues/490 is fixed
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest ./test",
},
single_python=True,
)
@@ -134,7 +138,9 @@ def test_dependency_groups(tmp_path):
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
"CIBW_TEST_COMMAND": f"false || {utils.invoke_pytest()} ./test",
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || pytest ./test",
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
# until https://github.com/oracle/graalpython/issues/490 is fixed
"CIBW_TEST_COMMAND_WINDOWS": "COLOR 00 || where graalpy || pytest ./test",
},
single_python=True,
)
@@ -189,7 +195,9 @@ def test_bare_pytest_invocation(tmp_path: Path, test_runner: str) -> None:
add_env={
"CIBW_TEST_REQUIRES": "pytest" if test_runner == "pytest" else "",
"CIBW_TEST_COMMAND": (
"python -m pytest"
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
# until https://github.com/oracle/graalpython/issues/490 fixed
"graalpy.exe -c 1 || python -m pytest"
if test_runner == "pytest"
else "python -m unittest discover test spam_test.py"
),
@@ -211,7 +219,9 @@ def test_test_sources(tmp_path):
add_env={
"CIBW_TEST_REQUIRES": "pytest",
"CIBW_TEST_COMMAND": "pytest",
"CIBW_TEST_COMMAND_WINDOWS": "pytest",
# pytest fails on GraalPy 24.2.0 on Windows so we skip it there
# until https://github.com/oracle/graalpython/issues/490 is fixed
"CIBW_TEST_COMMAND_WINDOWS": "where graalpy || pytest",
"CIBW_TEST_SOURCES": "test",
},
)