Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnome.generate_gir: allow to specify python executable #4973

Conversation

@nachogarglez
Copy link
Contributor

nachogarglez commented Feb 24, 2019

Adds a new parameter to generate_gir function in gnome
module, to allow specifying which python executable will
be used during the invocation to g-ir-scanner

This is necessary in some cases, for example pygobject
tests will generate a module for the default python
command, and they will fail if g-object-instrospection was
configured with other python version.

if kwargs.get('python_executable'):
python_cmd = ExternalProgram(kwargs.get('python_executable'))
giscanner_py = giscanner.held_object.get_path()
giscanner.held_object.command = [python_cmd.get_path(),giscanner_py]

This comment has been minimized.

Copy link
@ignatenkobrain

ignatenkobrain Feb 24, 2019

Member

[Flake8] [E231] missing whitespace after ','

posted by Sider

@nachogarglez nachogarglez force-pushed the nachogarglez:add-python_executable-option-to-generate-gir branch from a9382f9 to efaeaad Feb 24, 2019
@nachogarglez nachogarglez force-pushed the nachogarglez:add-python_executable-option-to-generate-gir branch 2 times, most recently from 12a38bd to 900002b Mar 17, 2019
@jpakkane

This comment has been minimized.

Copy link
Member

jpakkane commented Mar 28, 2019

This seems to only work if python_executable is a string, it should also accept an ExternalProgram.

Documentation needs to be updated as well as adding a release note snippet as this is new functionality.

Changing the guts of an existing ExternalProgram is suspicious. It should instead produce a completely new object with something like:

python_program = <ExternalProgram for Python>
giscanner = ExternalProgram(python_program.command + giscanner.command, silent=True)
@jpakkane

This comment has been minimized.

Copy link
Member

jpakkane commented Apr 21, 2019

ping

@jpakkane

This comment has been minimized.

Copy link
Member

jpakkane commented May 15, 2019

Ping again.

@dcbaker

This comment has been minimized.

Copy link
Member

dcbaker commented May 16, 2019

Is this really portable? it seems like each user would need to modify the build scripts so that it points at the correct python version on their system, right?

Adds a new parameter to generate_gir function in gnome
module, to allow specifying which python executable will
be used during the invocation to g-ir-scanner

This is necessary in some cases, for example pygobject
tests will generate a module for the default python
command, and they will fail if g-object-instrospection was
configured with other python version.
@nachogarglez nachogarglez force-pushed the nachogarglez:add-python_executable-option-to-generate-gir branch from 900002b to eee9088 Nov 3, 2019
@nachogarglez

This comment has been minimized.

Copy link
Contributor Author

nachogarglez commented Nov 3, 2019

Is this really portable? it seems like each user would need to modify the build scripts so that it points at the correct python version on their system, right?

Normally, you don't have to specify anything. But there are some corner cases when you need to generate python bindings with a different python version that the one being used by meson itself. Specially if that python version is older than the minimum required by Meson.

@nachogarglez

This comment has been minimized.

Copy link
Contributor Author

nachogarglez commented Nov 3, 2019

This seems to only work if python_executable is a string, it should also accept an ExternalProgram.

Documentation needs to be updated as well as adding a release note snippet as this is new functionality.

Changing the guts of an existing ExternalProgram is suspicious. It should instead produce a completely new object with something like:

python_program = <ExternalProgram for Python>
giscanner = ExternalProgram(python_program.command + giscanner.command, silent=True)

Sorry I totally lost the context for this patch. I have done my best with this and submitted a fix. Also I updated the documentation, as required.

@nachogarglez nachogarglez requested a review from ignatenkobrain Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.