GTK3 Python Codegen

Hello,

I’m working on an upgrade from GTK2→GTK3 and I’m running into an issue inside of a makefile. I’m going from:
$(PYMODSRC): $(PYMODDEFS) $(PYENUMSRC) $(PYMODMOD) $(PYOVERRIDE) $(PYINCS) gvshape_wrap.c -set PYTHONPATH=$(BASE_BUILD)\external\lib\python2.7\site-packages\gtk-2.0\codegen $(PYTHON) $(PYCODEGEN) --prefix _gv $(PYREGISTER) --override $(PYOVERRIDE) $(PYMODDEFS) > $(PYMODSRC)
to:
$(PYMODSRC): $(PYMODDEFS) $(PYENUMSRC) $(PYMODMOD) $(PYOVERRIDE) $(PYINCS) gvshape_wrap.c -set PYTHONPATH=$(BASE_BUILD)\external\lib\Python313 $(PYTHON) $(PYCODEGEN) --prefix _gv $(PYREGISTER) --override $(PYOVERRIDE) $(PYMODDEFS) > $(PYMODSRC)

With the main differences being the PYTHONPATH assignment. I believe the only variable that’s possibly causing an issue here is the following as there’s no GTK3 codegen file.
PYCODEGEN = $(PYTHON_ROOT)\lib\Python313\site-packages\gtk-$(PYGTK_VER)\codegen\codegen.py

Is there an equivalent to GTK2 python codegen files for GTK3? Is the approach here incorrect?

Hi,

I’m not aware of any codegen tool in gtk3 and later…

What was it for? to generate code from UI or Glade files? if yes, the new official method to use UI files is templates.

This has nothing to do with GTK; you’re probably seeing something related to the old, GTK2 era Python bindings. Those are not relevant to anything, any more. Bindings use introspection data, which is a description of a C ABI and is generated by libraries at build time.

Of course, it would help to give more context if you pointed to the code instead of copy-pasting some random Makefile fragment…