After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 542821 - remove codegen copy in PyGTK and always use PyGObject's copy
remove codegen copy in PyGTK and always use PyGObject's copy
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-13 20:19 UTC by Paul Pogonyshev
Modified: 2008-07-13 22:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for PyGObject to activate its codegen (834 bytes, patch)
2008-07-13 20:21 UTC, Paul Pogonyshev
committed Details | Review
patch for PyGTK to remove its codegen copy and use PyGObject's installed copy (310.21 KB, patch)
2008-07-13 20:25 UTC, Paul Pogonyshev
committed Details | Review

Description Paul Pogonyshev 2008-07-13 20:19:08 UTC
The subject says it all.  For instance, I just merged two patches from PyGTK to PyGObject, because the latter's codegen got out of sync.  Also, in PyGObject's 'codegen/argtypes.py' there is line "matcher.register('goffset', arg)", while in PyGTK there's not.  However, I don't know what to do about this if anything.

Patches follow.
Comment 1 Paul Pogonyshev 2008-07-13 20:21:28 UTC
Created attachment 114487 [details] [review]
patch for PyGObject to activate its codegen

After the patch it compiles, installs and works.  However, I didn't know what to do with file 'dsextras.py'.
Comment 2 Paul Pogonyshev 2008-07-13 20:25:50 UTC
Created attachment 114488 [details] [review]
patch for PyGTK to remove its codegen copy and use PyGObject's installed copy

After the patch it compiles, installs and works, and it is also possible to make distribution ('make dist').  After the patch and full rebuild 'gtk.c' remains the same (it _is_ build with installed PyGObject codegen now), which is a good indication that codegen is the same as used before :)  I didn't check if '.h' file scanning worked --- don't know how that's done.

I didn't know what to do with these files: 'docs/random/update-bindings' and 'pygtk_postinstall.py'.  I also don't know what happens on Windows.
Comment 3 Johan (not receiving bugmail) Dahlin 2008-07-13 20:57:01 UTC
Comment on attachment 114487 [details] [review]
patch for PyGObject to activate its codegen

let the win32 guys worry about dsextras.py
Comment 4 Johan (not receiving bugmail) Dahlin 2008-07-13 21:01:31 UTC
Comment on attachment 114488 [details] [review]
patch for PyGTK to remove its codegen copy and use PyGObject's installed copy

Thanks a lot Paul!
I really wanted to do this for a long time, but I never got around doing it.

I haven't looked at the patch in detail, but have you covered the following use case:

1) pygobject with codegen and pygtk without codegen? Should work.
2) pygobject with codegen and pygtk with codegen? Should work.
3) pygobject without codegen and pygtk without codegen? Should fail.

I'm sure you tested 1. 2 should ideally work so distributions & users can migrate incrementally.
3 is good to have, not strictly necessary but trivial to implement by ensuring a recent pygobject version in pygtk's configure.ac.
Comment 5 Paul Pogonyshev 2008-07-13 21:11:09 UTC
1 obviously works, I test my patches at least a little before submitting ;).  2 works too, just tested: installed patched PyGObject and unpatched PyGTK --- no apparent problems, PyGTK just uses its own codegen.  3 fails at configure step with message "unable to find PyGObject codegen" (i.e. when you try to install new PyGTK without first installing patched PyGObject).

About proper required version: I thought about it too, but maybe better to do right before releasing.  I don't know what version this will apply to.  Anyway, configure check should remain there just to filter out unexpected problems with somewhat helpful error message.
Comment 6 Paul Pogonyshev 2008-07-13 21:15:27 UTC
Committed PyGObject part.

Sending        ChangeLog
Sending        codegen/pygtk-codegen-2.0.in
Sending        pygobject-2.0.pc.in
Transmitting file data ...
Committed revision 795.
Comment 7 Johan (not receiving bugmail) Dahlin 2008-07-13 21:37:52 UTC
Okay, sound good then! Please commit!

I'll probably do a pygobject release real soon now, this was the last pending task on my mental todo.
Comment 8 Paul Pogonyshev 2008-07-13 22:00:12 UTC
Before release, we really need more testing.  Committing second patch:

Sending        ChangeLog
Sending        MANIFEST.in
Sending        Makefile.am
Deleting       codegen
Sending        configure.in
Sending        gtk/Makefile.am
Deleting       pygobject-2.0.pc.in
Sending        pygtk-2.0.pc.in
Sending        pygtk.spec.in
Sending        setup.py
Transmitting file data ........
Committed revision 3006.