TypeErrors with pypy3.10
There seem to be some type problem when using pyobject under PyPy3.10 7.3.12. PyPy3.9 works fine.
For example:
>>>> from gi.repository import Gio
>>>> Gio.Application(flags=Gio.ApplicationFlags.FLAGS_NONE)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: could not convert value for property `flags' from ApplicationFlags to GApplicationFlags
I also see test failures but I'm not 100% sure it's the same problem:
$ meson .. -Dtests=true -Dpython=pypy3.10
[…]
$ ninja test
[56/57] Running all tests.
1/1 pygobject-test-suite FAIL 2.41s exit status 2
>>> LD_LIBRARY_PATH=/tmp/pygobject/build/tests MALLOC_PERTURB_=128 PYTHONPATH=/tmp/pygobject/build/tests/..:/tmp/pygobject/build/subprojects/pycairo GI_TYPELIB_PATH=/tmp/pygobject/build/tests TESTS_BUILDDIR=/tmp/pygobject/build/tests /usr/bin/pypy3.10 /tmp/pygobject/tests/runtests.py
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Listing only the last 100 lines from a long log.
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:688: in _load_unlocked
???
/usr/lib/pypy3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
../tests/test_internal_api.py:11: in <module>
class PyGObject(GObject.GObject):
../gi/types.py:226: in __init__
super(GObjectMeta, cls).__init__(name, bases, dict_)
../gi/types.py:205: in __init__
cls._type_register(cls.__dict__)
../gi/types.py:217: in _type_register
_gi.type_register(cls, namespace.get('__gtype_name__'))
E TypeError: Must be number, not ParamFlags
__________________ ERROR collecting tests/test_properties.py ___________________
/usr/lib/pypy3.10/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
/usr/lib/pypy3.10/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/pypy3.10/site-packages/_pytest/python.py:531: in collect
self._inject_setup_module_fixture()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
/usr/lib/pypy3.10/site-packages/_pytest/python.py:310: in obj
self._obj = obj = self._getobj()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:528: in _getobj
return self._importtestmodule()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:617: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/pypy3.10/site-packages/_pytest/pathlib.py:565: in import_path
importlib.import_module(module_name)
/usr/lib/pypy3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:688: in _load_unlocked
???
/usr/lib/pypy3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
../tests/test_properties.py:33: in <module>
class PropertyObject(GObject.GObject):
../gi/types.py:226: in __init__
super(GObjectMeta, cls).__init__(name, bases, dict_)
../gi/types.py:205: in __init__
cls._type_register(cls.__dict__)
../gi/types.py:217: in _type_register
_gi.type_register(cls, namespace.get('__gtype_name__'))
E TypeError: Must be number, not ParamFlags
____________________ ERROR collecting tests/test_signal.py _____________________
/usr/lib/pypy3.10/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
/usr/lib/pypy3.10/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/pypy3.10/site-packages/_pytest/python.py:531: in collect
self._inject_setup_module_fixture()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
self.obj, ("setUpModule", "setup_module")
/usr/lib/pypy3.10/site-packages/_pytest/python.py:310: in obj
self._obj = obj = self._getobj()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:528: in _getobj
return self._importtestmodule()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:617: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/pypy3.10/site-packages/_pytest/pathlib.py:565: in import_path
importlib.import_module(module_name)
/usr/lib/pypy3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:688: in _load_unlocked
???
/usr/lib/pypy3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
exec(co, module.__dict__)
../tests/test_signal.py:486: in <module>
class SigPropClass(GObject.GObject):
../gi/types.py:226: in __init__
super(GObjectMeta, cls).__init__(name, bases, dict_)
../gi/types.py:205: in __init__
cls._type_register(cls.__dict__)
../gi/types.py:217: in _type_register
_gi.type_register(cls, namespace.get('__gtype_name__'))
E TypeError: Must be number, not ParamFlags
=========================== short test summary info ============================
ERROR ../tests/test_internal_api.py - TypeError: Must be number, not ParamFlags
ERROR ../tests/test_properties.py - TypeError: Must be number, not ParamFlags
ERROR ../tests/test_signal.py - TypeError: Must be number, not ParamFlags
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 3 errors in 1.61s ===============================
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Summary of Failures:
1/1 pygobject-test-suite FAIL 2.41s exit status 2
Ok: 0
Expected Fail: 0
Fail: 1
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /tmp/pygobject/build/meson-logs/testlog.txt
FAILED: meson-internal__test
/usr/lib/python-exec/python3.12/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed.
This is Gentoo Linux amd64, confirmed on d3d4b9b1. If you think that this is a problem with PyPy3.10, I can proxy a bug report.