aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-01-12 10:50:22 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-01-13 13:32:48 -0800
commit022632c91b255739c5100601a02b197cb29cd23e (patch)
tree1b624726c0f5d801f7588e054a34bf70c4f8b8cb /mesonbuild/build.py
parent6180992d4939f931aaeae74138dae069a60a3485 (diff)
downloadmeson-022632c91b255739c5100601a02b197cb29cd23e.zip
meson-022632c91b255739c5100601a02b197cb29cd23e.tar.gz
meson-022632c91b255739c5100601a02b197cb29cd23e.tar.bz2
build/interperter: Add annotations and move input validation to interpreter
This moves the user input validation to the interpreter, instead of being in the build module, and adds type annotations.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index dacf68b..736d42c 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -2567,19 +2567,15 @@ class ConfigurationData:
# A bit poorly named, but this represents plain data files to copy
# during install.
class Data:
- def __init__(self, sources, install_dir, install_mode=None, rename=None):
+ def __init__(self, sources: T.List[File], install_dir: str,
+ install_mode: T.Optional['FileMode'] = None, rename: T.List[str] = None):
self.sources = sources
self.install_dir = install_dir
self.install_mode = install_mode
- self.sources = listify(self.sources)
- for s in self.sources:
- assert(isinstance(s, File))
if rename is None:
self.rename = [os.path.basename(f.fname) for f in self.sources]
else:
- self.rename = stringlistify(rename)
- if len(self.rename) != len(self.sources):
- raise MesonException('Size of rename argument is different from number of sources')
+ self.rename = rename
class RunScript(dict):
def __init__(self, script, args):