alexlarsson / gnome-sdk-images

5 stars 1 forks source link

The Sdk should provide gst-python #9

Closed thiblahute closed 8 years ago

thiblahute commented 8 years ago

It already packages everything to work with GI/python and GStreamer, it should also provide the Gst python overrides, moreover packaging GI overrides that will land into /app makes it very ugly to be able to use them.

alexlarsson commented 8 years ago

Couldn't we just patch our python-gobject build to always do something equivalent to this: gi.overrides.path.insert(0, "/app/lib/python3.3/site-packages/gi/")

thiblahute commented 8 years ago

That would be a good idea indeed :)

Also tbh. distributing Gst with PyGobject support but not the overrides is probably not a very good idea (people will expect it to work, but it will work very badly).

alexlarsson commented 8 years ago

It seems to me that pygobject does this correctly by using pkgutil.extend_path(). If i create the right directory in my app (/app/lib/python3.3/site-packages/gi) then I get:

$ python3 -c "import gi; print (gi.__path__);"
['/usr/lib/python3.3/site-packages/gi', '/app/lib/python3.3/site-packages/gi']

Which seems right to me.

alexlarsson commented 8 years ago

I just built a new version of the runtime with gst-python on it. Can you test it?

alexlarsson commented 8 years ago

Also, it changed the usercustomize.py to use site.addsitedir()

thiblahute commented 8 years ago

I do not see GstPython in latest Sdk/Platform:

thiblahute@~  $ xdg-app update-runtime --user org.gnome.Sdk 3.18     
thiblahute@~  $ xdg-app update-runtime --user org.gnome.Platform 3.18
thiblahute@~  $ xdg-app build-init /tmp/test org.test.Test org.gnome.Sdk org.gnome.Platform 3.18
thiblahute@~  $ xdg-app build /tmp/test/ bash -c "find /usr/ -name Gst.py"                      
thiblahute@~  $ xdg-app build /tmp/test/ python3 -c "from gi.repository import Gst; print(Gst.Fraction)"
sys:1: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
<class 'gi.repository.Gst.Fraction'>
thiblahute@~  $ python3 -c "from gi.repository import Gst; print(Gst.Fraction)"
sys:1: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
<class 'gi.overrides.Gst.Fraction'>
alexlarsson commented 8 years ago

Yeah. i built it but did not include it... epic.

alexlarsson commented 8 years ago

New version untagging atm, will be done in a minute or so, can you try again

thiblahute commented 8 years ago

Looks all good now :)