summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/python.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-10-20 15:51:39 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-12-17 10:27:54 -0800
commit2488f3f4b2f192a11d62534a08e792fd36f800c0 (patch)
treeec58c37bf3462f6f5824e19250252162d7e1157d /mesonbuild/modules/python.py
parentcb7431b1200871e7a70499a8e02b82dc0fa32c39 (diff)
downloadmeson-2488f3f4b2f192a11d62534a08e792fd36f800c0.tar.gz
interpreter: Add type checking for BuildTarget(install_dir: )
This just puts the type checking in the frontend, there's still some serious cleanup in the build and backend that need to happen.
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r--mesonbuild/modules/python.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index 99602c05a..3d8969f41 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -22,7 +22,7 @@ from ..interpreterbase import (
InvalidArguments, typed_pos_args, typed_kwargs, KwargInfo,
FeatureNew, disablerIfNotFound, InterpreterObject
)
-from ..mesonlib import MachineChoice
+from ..mesonlib import MachineChoice, listify
from ..options import OptionKey
from ..programs import ExternalProgram, NonExistingExternalProgram
@@ -60,7 +60,8 @@ mod_kwargs = {'subdir', 'limited_api'}
mod_kwargs.update(known_shmod_kwargs)
mod_kwargs -= {'name_prefix', 'name_suffix'}
-_MOD_KWARGS = [k for k in SHARED_MOD_KWS if k.name not in {'name_prefix', 'name_suffix'}]
+_MOD_KWARGS = [k for k in SHARED_MOD_KWS if
+ k.name not in {'name_prefix', 'name_suffix', 'install_dir'}]
class PythonExternalProgram(BasicPythonExternalProgram):
@@ -145,13 +146,15 @@ class PythonInstallation(_ExternalProgramHolder['PythonExternalProgram']):
if 'install_dir' in kwargs:
if kwargs['subdir'] is not None:
raise InvalidArguments('"subdir" and "install_dir" are mutually exclusive')
+ # the build_target() method now expects this to be correct.
+ kwargs['install_dir'] = listify(kwargs['install_dir'])
else:
# We want to remove 'subdir', but it may be None and we want to replace it with ''
# It must be done this way since we don't allow both `install_dir`
# and `subdir` to be set at the same time
subdir = kwargs.pop('subdir') or ''
- kwargs['install_dir'] = self._get_install_dir_impl(False, subdir)
+ kwargs['install_dir'] = [self._get_install_dir_impl(False, subdir)]
target_suffix = self.suffix