modules/python: Report program found in find_installation()
Currently find_installation is silent, which is pretty annoying. Let's log it.
This commit is contained in:
parent
3d04e5a150
commit
82346a2bd2
|
@ -131,7 +131,7 @@ class PythonDependency(ExternalDependency):
|
|||
if self.is_found:
|
||||
mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES ({})'.format(py_lookup_method)))
|
||||
else:
|
||||
mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO'))
|
||||
mlog.log('Dependency', mlog.bold(self.name), 'found:', [mlog.red('NO')])
|
||||
|
||||
def _find_libpy(self, python_holder, environment):
|
||||
if python_holder.is_pypy:
|
||||
|
@ -512,8 +512,7 @@ class PythonModule(ExtensionModule):
|
|||
raise InvalidArguments('find_installation argument must be a string.')
|
||||
|
||||
if not name_or_path:
|
||||
mlog.log("Using meson's python {}".format(mesonlib.python_command))
|
||||
python = ExternalProgram('python3', mesonlib.python_command, silent=True)
|
||||
python = ExternalProgram('python3', mesonlib.python_command)
|
||||
else:
|
||||
python = ExternalProgram.from_entry('python3', name_or_path)
|
||||
|
||||
|
@ -530,6 +529,9 @@ class PythonModule(ExtensionModule):
|
|||
if not python.found() and name_or_path in ['python2', 'python3']:
|
||||
python = ExternalProgram('python', silent=True)
|
||||
|
||||
mlog.log('Program', python.name, 'found:',
|
||||
*[mlog.green('YES'), '({})'.format(' '.join(python.command))] if python.found() else [mlog.red('NO')])
|
||||
|
||||
if not python.found():
|
||||
if required:
|
||||
raise mesonlib.MesonException('{} not found'.format(name_or_path or 'python'))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
project('python sample', 'c')
|
||||
|
||||
py_mod = import('python')
|
||||
py = py_mod.find_installation()
|
||||
py = py_mod.find_installation('python3')
|
||||
|
||||
py_version = py.language_version()
|
||||
if py_version.version_compare('< 3.2')
|
||||
|
|
Loading…
Reference in New Issue