diff --git a/docs/markdown/Python-module.md b/docs/markdown/Python-module.md index 20eae1a32..6f4120d3a 100644 --- a/docs/markdown/Python-module.md +++ b/docs/markdown/Python-module.md @@ -112,6 +112,8 @@ following keyword argument: - `embed`: *(since 0.53.0)* If true, Meson will try to find a python dependency that can be used for embedding python into an application. +- `disabler` *(since 0.60.0)*: if `true` and the dependency couldn't be found, + returns a [disabler object](#disabler-object) instead of a not-found dependency. **Returns**: a [python dependency][`python_dependency` object] diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index d03f951cd..f25957d7a 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -458,6 +458,7 @@ class PythonInstallation(ExternalProgramHolder): return self.interpreter.func_shared_module(None, args, kwargs) + @disablerIfNotFound @permittedKwargs(permitted_dependency_kwargs | {'embed'}) @FeatureNewKwargs('python_installation.dependency', '0.53.0', ['embed']) @noPosargs