Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,24 @@ jobs:
cibw_arch: 'arm64'
cibw_build: false
os: 'macos-latest'
- name: 'graalpy242-nocov (ubuntu/x86_64/manylinux)'
artifact: 'graalpy242-ubuntu-x86_64-manylinux'
python: 'graalpy-24.2'
toxpython: 'graalpy'
python_arch: 'x64'
tox_env: 'graalpy-nocov'
cibw_arch: 'x86_64'
cibw_build: false
os: 'ubuntu-latest'
- name: 'graalpy242-nocov (macos/arm64)'
artifact: 'graalpy242-macos-arm64'
python: 'graalpy-24.2'
toxpython: 'graalpy'
python_arch: 'arm64'
tox_env: 'graalpy-nocov'
cibw_arch: 'arm64'
cibw_build: false
os: 'macos-latest'
steps:
- uses: docker/setup-qemu-action@v3
if: matrix.cibw_arch == 'aarch64'
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
LFLAGS = ''

allow_extensions = True
if '__pypy__' in sys.builtin_module_names:
print('NOTICE: C extensions disabled on PyPy (would be broken)!')
if sys.implementation.name in ('pypy', 'graalpy'):
print('NOTICE: C extensions disabled on PyPy/GraalPy (would be broken)!')
allow_extensions = False
if os.environ.get('SETUPPY_FORCE_PURE'):
print('NOTICE: C extensions disabled (SETUPPY_FORCE_PURE)!')
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest

PYPY = '__pypy__' in sys.builtin_module_names
GRAALPY = sys.implementation.name == 'graalpy'


@pytest.fixture(scope='session')
Expand All @@ -20,7 +21,7 @@ class FakeModule:
try:
from lazy_object_proxy.cext import Proxy
except ImportError:
if PYPY or os.environ.get('SETUPPY_FORCE_PURE'):
if PYPY or GRAALPY or os.environ.get('SETUPPY_FORCE_PURE'):
pytest.skip(reason='C Extension not available.')
else:
raise
Expand Down
12 changes: 12 additions & 0 deletions tests/test_async_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from lazy_object_proxy.utils import await_

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


class AsyncYieldFrom:
Expand Down Expand Up @@ -75,6 +76,7 @@ def gen():
assert not hasattr(gen, '__await__')


@graalpyxfail
def test_func_1(lop):
async def foo():
return 10
Expand All @@ -95,6 +97,7 @@ def bar():
assert not bool(bar.__code__.co_flags & inspect.CO_COROUTINE)


@graalpyxfail
def test_func_2(lop):
async def foo():
raise StopIteration
Expand Down Expand Up @@ -269,6 +272,7 @@ async def func():
coro.close()


@graalpyxfail
def test_func_12(lop):
async def g():
i = me.send(None)
Expand All @@ -279,6 +283,7 @@ async def g():
me.send(None)


@graalpyxfail
def test_func_13(lop):
async def g():
pass
Expand All @@ -290,6 +295,7 @@ async def g():
coro.close()


@graalpyxfail
def test_func_14(lop):
@types.coroutine
def gen():
Expand Down Expand Up @@ -777,6 +783,7 @@ async def foo():
run_async(lop.Proxy(foo))


@graalpyxfail
def test_with_2(lop):
class CM:
def __aenter__(self):
Expand Down Expand Up @@ -845,6 +852,7 @@ async def func():


@pypyxfail
@graalpyxfail
def test_with_6(lop):
class CM:
def __aenter__(self):
Expand All @@ -863,6 +871,7 @@ async def foo():


@pypyxfail
@graalpyxfail
def test_with_7(lop):
class CM:
async def __aenter__(self):
Expand All @@ -887,6 +896,7 @@ async def foo():


@pypyxfail
@graalpyxfail
def test_with_8(lop):
CNT = 0

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


@graalpyxfail
def test_with_11(lop):
CNT = 0

Expand Down Expand Up @@ -1032,6 +1043,7 @@ async def foo():
run_async(lop.Proxy(foo))


@graalpyxfail
def test_with_13(lop):
CNT = 0

Expand Down
4 changes: 4 additions & 0 deletions tests/test_lazy_object_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

PYPY = '__pypy__' in sys.builtin_module_names

graalpyxfail = pytest.mark.xfail('sys.implementation.name == "graalpy"')

OBJECTS_CODE = """
class TargetBaseClass(object):
"documentation"
Expand Down Expand Up @@ -223,6 +225,7 @@ def test_function_doc_string(lop):
assert wrapper.__doc__ == target.__doc__


@graalpyxfail
def test_class_of_class(lop):
# Test preservation of class __class__ attribute.

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


@graalpyxfail
def test_class_of_function(lop):
# Test preservation of function __class__ attribute.

Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ envlist =
clean,
check,
docs,
{py39,py310,py311,py312,py313,py313-ft,pypy39,pypy310}-{cover,nocov},
{py39,py310,py311,py312,py313,py313-ft,pypy39,pypy310,graalpy}-{cover,nocov},
report
ignore_basepython_conflict = true

Expand All @@ -28,6 +28,7 @@ basepython =
py312: {env:TOXPYTHON:python3.12}
py313: {env:TOXPYTHON:python3.13}
py313ft: {env:TOXPYTHON:python3.13t}
graalpy: {env:TOXPYTHON:graalpy}
{bootstrap,clean,check,report,docs,codecov,coveralls,extension-coveralls}: {env:TOXPYTHON:python3}
setenv =
PYTHONPATH={toxinidir}/tests
Expand Down
Loading