Build failure with Python 3.11
I'm getting compile errors in pygobject in GStreamer's monorepo that seems to be an API change in Python 3.11 (https://bugs.python.org/issue45476)
../subprojects/pygobject/gi/pygboxed.c: In function ‘pygi_register_gboxed’:
../subprojects/pygobject/gi/pygboxed.c:157:19: error: lvalue required as left operand of assignment
157 | Py_TYPE(type) = &PyType_Type;
../subprojects/pygobject/gi/pyginterface.c: In function ‘pyg_register_interface’:
../subprojects/pygobject/gi/pyginterface.c:72:19: error: lvalue required as left operand of assignment
72 | Py_TYPE(type) = &PyType_Type;
../subprojects/pygobject/gi/pygpointer.c: In function ‘pyg_register_pointer’:
../subprojects/pygobject/gi/pygpointer.c:117:19: error: lvalue required as left operand of assignment
117 | Py_TYPE(type) = &PyType_Type;
../subprojects/pygobject/gi/pygparamspec.c: In function ‘pygi_paramspec_register_types’:
../subprojects/pygobject/gi/pygparamspec.c:409:33: error: lvalue required as left operand of assignment
409 | Py_TYPE(&PyGParamSpec_Type) = &PyType_Type;
../subprojects/pygobject/gi/gimodule.c: In function ‘pyg__install_metaclass’:
../subprojects/pygobject/gi/gimodule.c:2256:30: error: lvalue required as left operand of assignment
2256 | Py_TYPE(&PyGObject_Type) = metaclass;
../subprojects/pygobject/gi/pygobject-object.c: In function ‘pygobject_register_class’:
../subprojects/pygobject/gi/pygobject-object.c:563:19: error: lvalue required as left operand of assignment
563 | Py_TYPE(type) = PyGObject_MetaType;
Also, there's a deprecation warning:
../subprojects/pygobject/gi/gimodule.c: In function ‘PyInit__gi’:
../subprojects/pygobject/gi/gimodule.c:2530:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
2530 | PyEval_InitThreads ();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:95,
from ../subprojects/pygobject/gi/gimodule.c:24:
/usr/include/python3.11/ceval.h:132:37: note: declared here
132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);