aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-04-09 15:44:27 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2018-04-09 15:46:06 +0200
commitc3bc7873e9cd735d331e58ef03ba858151ffe12a (patch)
treefe91b48431a24c182ee5fdee33c28a8524d0b6e1 /mesonbuild/modules/python.py
parent56fc22075cf3628727f15e24ad738d70c5e4d01a (diff)
downloadmeson-c3bc7873e9cd735d331e58ef03ba858151ffe12a.zip
meson-c3bc7873e9cd735d331e58ef03ba858151ffe12a.tar.gz
meson-c3bc7873e9cd735d331e58ef03ba858151ffe12a.tar.bz2
[fixup]: various minor tweaks found while documenting
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r--mesonbuild/modules/python.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index e4f2ce8..b0d1310 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -36,6 +36,7 @@ from ..dependencies.base import (
mod_kwargs = set(['subdir'])
mod_kwargs.update(known_shmod_kwargs)
+mod_kwargs -= set(['name_prefix', 'name_suffix'])
def run_command(python, command):
@@ -240,11 +241,6 @@ class PythonInstallation(ExternalProgramHolder, InterpreterObject):
@permittedSnippetKwargs(mod_kwargs)
def extension_module(self, interpreter, state, args, kwargs):
- if 'name_prefix' in kwargs:
- raise mesonlib.MesonException('Name_prefix is set automatically, specifying it is forbidden.')
- if 'name_suffix' in kwargs:
- raise mesonlib.MesonException('Name_suffix is set automatically, specifying it is forbidden.')
-
if 'subdir' in kwargs and 'install_dir' in kwargs:
raise InvalidArguments('"subdir" and "install_dir" are mutually exclusive')
@@ -291,7 +287,7 @@ class PythonInstallation(ExternalProgramHolder, InterpreterObject):
@noPosargs
@permittedKwargs(['pure', 'subdir'])
def get_install_dir(self, node, args, kwargs):
- pure = kwargs.pop('pure', False)
+ pure = kwargs.pop('pure', True)
if not isinstance(pure, bool):
raise InvalidArguments('"pure" argument must be a boolean.')
@@ -386,13 +382,13 @@ class PythonModule(ExtensionModule):
if not isinstance(required, bool):
raise InvalidArguments('"required" argument must be a boolean.')
- if len(args) != 1:
- raise InvalidArguments('find takes zero or one positional argument.')
+ if len(args) > 1:
+ raise InvalidArguments('find_installation takes zero or one positional argument.')
if args:
name_or_path = args[0]
if not isinstance(name_or_path, str):
- raise InvalidArguments('find argument must be a string.')
+ raise InvalidArguments('find_installation argument must be a string.')
else:
name_or_path = None