We do not need the python module's find_installation() for this, as this does various things to set up building and installing python modules (pure python and C-API). This functionality is already tested in the python tests. Elsewhere, when we just need an interpreter capable of running python scripts in order to guarantee a useful scripting language for custom commands, it suffices to use find_program(), which does not run an introspection script or do module imports, and is thus faster and a bit cleaner. Either way, both methods are guaranteed to find the python3 interpreter, deferring to mesonlib.python_command for that guarantee. test "71 summary" can sometimes return the python command with the ".exe" part all uppercased for mysterious Windows reasons. Smooth this over with ExternalProgram.pull/11461/head
parent
9f05d45b70
commit
cf07596cf6
13 changed files with 18 additions and 15 deletions
@ -1,7 +1,7 @@ |
||||
project('trivial test', 'c') |
||||
|
||||
py_inst = import('python').find_installation() |
||||
python = find_program('python3') |
||||
|
||||
exe = executable('trivialprog', 'trivial.c') |
||||
runt = run_target('invalid', command: [py_inst, '--version']) |
||||
runt = run_target('invalid', command: [python, '--version']) |
||||
test('runtest', exe, args: runt) |
||||
|
@ -1,7 +1,7 @@ |
||||
project('trivial test', 'c') |
||||
|
||||
py_inst = import('python').find_installation() |
||||
python = find_program('python3') |
||||
|
||||
exe = executable('trivialprog', 'trivial.c') |
||||
runt = run_target('invalid', command: [py_inst, '--version']) |
||||
runt = run_target('invalid', command: [python, '--version']) |
||||
meson.add_install_script(exe, runt) |
||||
|
@ -1 +1,2 @@ |
||||
option('enabled_opt', type: 'feature', value: 'auto') |
||||
option('python', type: 'string') |
||||
|
@ -1,3 +1,3 @@ |
||||
python3 = import('python').find_installation('') |
||||
python3 = find_program('python3') |
||||
|
||||
test('run_exe', python3, args: [files('test_run_exe.py')[0], barexe]) |
||||
|
Loading…
Reference in new issue