Skip to content

Commit 4db87e6

Browse files
msimacekionelmc
authored andcommitted
Test GraalPy in the CI
1 parent 9ba6f66 commit 4db87e6

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

.github/workflows/github-actions.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,24 @@ jobs:
673673
cibw_arch: 'arm64'
674674
cibw_build: false
675675
os: 'macos-latest'
676+
- name: 'graalpy242-nocov (ubuntu/x86_64/manylinux)'
677+
artifact: 'graalpy242-ubuntu-x86_64-manylinux'
678+
python: 'graalpy-24.2'
679+
toxpython: 'graalpy'
680+
python_arch: 'x64'
681+
tox_env: 'graalpy-nocov'
682+
cibw_arch: 'x86_64'
683+
cibw_build: false
684+
os: 'ubuntu-latest'
685+
- name: 'graalpy242-nocov (macos/arm64)'
686+
artifact: 'graalpy242-macos-arm64'
687+
python: 'graalpy-24.2'
688+
toxpython: 'graalpy'
689+
python_arch: 'arm64'
690+
tox_env: 'graalpy-nocov'
691+
cibw_arch: 'arm64'
692+
cibw_build: false
693+
os: 'macos-latest'
676694
steps:
677695
- uses: docker/setup-qemu-action@v3
678696
if: matrix.cibw_arch == 'aarch64'

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55

66
PYPY = '__pypy__' in sys.builtin_module_names
7+
GRAALPY = sys.implementation.name == 'graalpy'
78

89

910
@pytest.fixture(scope='session')
@@ -20,7 +21,7 @@ class FakeModule:
2021
try:
2122
from lazy_object_proxy.cext import Proxy
2223
except ImportError:
23-
if PYPY or os.environ.get('SETUPPY_FORCE_PURE'):
24+
if PYPY or GRAALPY or os.environ.get('SETUPPY_FORCE_PURE'):
2425
pytest.skip(reason='C Extension not available.')
2526
else:
2627
raise

tests/test_async_py3.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from lazy_object_proxy.utils import await_
1414

1515
pypyxfail = pytest.mark.xfail('hasattr(sys, "pypy_version_info")')
16+
graalpyxfail = pytest.mark.xfail('sys.implementation.name == "graalpy"')
1617

1718

1819
class AsyncYieldFrom:
@@ -75,6 +76,7 @@ def gen():
7576
assert not hasattr(gen, '__await__')
7677

7778

79+
@graalpyxfail
7880
def test_func_1(lop):
7981
async def foo():
8082
return 10
@@ -95,6 +97,7 @@ def bar():
9597
assert not bool(bar.__code__.co_flags & inspect.CO_COROUTINE)
9698

9799

100+
@graalpyxfail
98101
def test_func_2(lop):
99102
async def foo():
100103
raise StopIteration
@@ -269,6 +272,7 @@ async def func():
269272
coro.close()
270273

271274

275+
@graalpyxfail
272276
def test_func_12(lop):
273277
async def g():
274278
i = me.send(None)
@@ -279,6 +283,7 @@ async def g():
279283
me.send(None)
280284

281285

286+
@graalpyxfail
282287
def test_func_13(lop):
283288
async def g():
284289
pass
@@ -290,6 +295,7 @@ async def g():
290295
coro.close()
291296

292297

298+
@graalpyxfail
293299
def test_func_14(lop):
294300
@types.coroutine
295301
def gen():
@@ -777,6 +783,7 @@ async def foo():
777783
run_async(lop.Proxy(foo))
778784

779785

786+
@graalpyxfail
780787
def test_with_2(lop):
781788
class CM:
782789
def __aenter__(self):
@@ -845,6 +852,7 @@ async def func():
845852

846853

847854
@pypyxfail
855+
@graalpyxfail
848856
def test_with_6(lop):
849857
class CM:
850858
def __aenter__(self):
@@ -863,6 +871,7 @@ async def foo():
863871

864872

865873
@pypyxfail
874+
@graalpyxfail
866875
def test_with_7(lop):
867876
class CM:
868877
async def __aenter__(self):
@@ -887,6 +896,7 @@ async def foo():
887896

888897

889898
@pypyxfail
899+
@graalpyxfail
890900
def test_with_8(lop):
891901
CNT = 0
892902

@@ -990,6 +1000,7 @@ async def foo():
9901000
pytest.fail('exception from __aexit__ did not propagate')
9911001

9921002

1003+
@graalpyxfail
9931004
def test_with_11(lop):
9941005
CNT = 0
9951006

@@ -1032,6 +1043,7 @@ async def foo():
10321043
run_async(lop.Proxy(foo))
10331044

10341045

1046+
@graalpyxfail
10351047
def test_with_13(lop):
10361048
CNT = 0
10371049

tests/test_lazy_object_proxy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
PYPY = '__pypy__' in sys.builtin_module_names
1616

17+
graalpyxfail = pytest.mark.xfail('sys.implementation.name == "graalpy"')
18+
1719
OBJECTS_CODE = """
1820
class TargetBaseClass(object):
1921
"documentation"
@@ -223,6 +225,7 @@ def test_function_doc_string(lop):
223225
assert wrapper.__doc__ == target.__doc__
224226

225227

228+
@graalpyxfail
226229
def test_class_of_class(lop):
227230
# Test preservation of class __class__ attribute.
228231

@@ -271,6 +274,7 @@ def test_class_of_instance(lop):
271274
assert isinstance(wrapper, objects.TargetBaseClass)
272275

273276

277+
@graalpyxfail
274278
def test_class_of_function(lop):
275279
# Test preservation of function __class__ attribute.
276280

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ envlist =
1414
clean,
1515
check,
1616
docs,
17-
{py39,py310,py311,py312,py313,py313-ft,pypy39,pypy310}-{cover,nocov},
17+
{py39,py310,py311,py312,py313,py313-ft,pypy39,pypy310,graalpy}-{cover,nocov},
1818
report
1919
ignore_basepython_conflict = true
2020

@@ -28,6 +28,7 @@ basepython =
2828
py312: {env:TOXPYTHON:python3.12}
2929
py313: {env:TOXPYTHON:python3.13}
3030
py313ft: {env:TOXPYTHON:python3.13t}
31+
graalpy: {env:TOXPYTHON:graalpy}
3132
{bootstrap,clean,check,report,docs,codecov,coveralls,extension-coveralls}: {env:TOXPYTHON:python3}
3233
setenv =
3334
PYTHONPATH={toxinidir}/tests

0 commit comments

Comments
 (0)