GNOME Bugzilla – Bug 796092
meson: use new python module
Last modified: 2018-10-31 00:03:51 UTC
Created attachment 371989 [details] [review] meson: use new python module This patch makes the tests pass running uninstalled and installed, with python2 and python3 on linux, windows and osx. The main gist is to use the new python-module to do the lifting done by pythondetector, and with that add support for python2 and windows.
Review of attachment 371989 [details] [review]: ::: gi/overrides/meson.build @@ +14,3 @@ # Workaround to get uninstalled working. foreach source: pysources + run_command(python, '-c', 'import os; os.symlink("@0@/@1@", "@2@/@3@")'.format( Are you convince this won't default to python 2 instead of 3 ? Would be a bit backward, since we are dropping python 2 in cerbero and eventually other build tools.
(In reply to Nicolas Dufresne (ndufresne) from comment #1) > Review of attachment 371989 [details] [review] [review]: > > ::: gi/overrides/meson.build > @@ +14,3 @@ > # Workaround to get uninstalled working. > foreach source: pysources > + run_command(python, '-c', 'import os; os.symlink("@0@/@1@", > "@2@/@3@")'.format( > > Are you convince this won't default to python 2 instead of 3 ? Would be a > bit backward, since we are dropping python 2 in cerbero and eventually other > build tools. If you look in meson_options.txt you will see python3 is the default. It would be a good idea to support Python 2 until at least it is end-of-life: https://pythonclock.org/. A lot of frameworks (like twisted) still only works with Python 2.
Ok, thanks for the clarification.
(In reply to Håvard Graff (hgr) from comment #2) > It would be a good idea to support Python 2 until at least it is end-of-life: > https://pythonclock.org/. A lot of frameworks (like twisted) still only > works with Python 2. I didn't know there was a set date, I guess we can keep supporting until 1/1/2020 indeed.
ping?
Review of attachment 371989 [details] [review]: The meson_version attribute should be bumped: WARNING: Project specifies a minimum meson_version '>= 0.36.0' but uses features which were added in newer versions: * 0.37.0: {'shared_module'} * 0.46.0: {'Python Module'} ::: meson.build @@ +23,2 @@ pygobject_dep = dependency('pygobject-3.0', version : '>= 3.8') python_dep = dependency('python3') This can be removed? @@ +38,3 @@ pygi_override_dir = get_option('pygi-overrides-dir') if pygi_override_dir == '' + cres = run_command(python, '-c',''' Why not save this to a separate file? It would support syntax highlighting other dev tools. @@ +47,3 @@ + print(path) + exit(0) +exit(1) This does not have the “Otherwise follow python's way of install site packages inside the provided prefix” branch from the original detector script, making it fail in cases where `gi.overrides.__path__` does not start with `prefix` (e.g. on NixOS). But since the value can be fixed using meson option, it is probably alright.
*** Bug 797138 has been marked as a duplicate of this bug. ***
Review of attachment 371989 [details] [review]: I have committed this, and addressed the review comments in a separate commit, thanks Havard!
*** Bug 792873 has been marked as a duplicate of this bug. ***