Commit Graph

34 Commits

Author SHA1 Message Date
Dylan Baker 4a2058cb83 interpreter: use typed_kwargs for subproject() 2022-03-03 10:29:14 -08:00
Dylan Baker 23f666b497 interpreter: use typed_kwargs for configure_file 2022-03-01 15:17:59 -05:00
Eli Schwartz 07d9c72e17
flake8: fix wrong numbers of blank line separators 2022-02-16 18:19:13 -05:00
Dylan Baker 11f9638035 build: replace kwargs in CustomTarget initializer
Because we don't want to pass the Interpreter kwargs into the build
layer. This turned out to be a mega commit, as there's really on elegant
way to make this change in an incremental way. On the nice side, mypy
made this change super easy, as nearly all of the calls to
`CustomTarget` are fully type checked!

It also turns out that we're not handling install_tags in custom_target
correctly, since we're not converting the boolean values into Optional
values!
2022-01-28 15:53:20 -05:00
Dylan Baker 08f06b237e interpreter: use typed_kwargs for vcs_tag 2022-01-28 15:53:20 -05:00
Dylan Baker 574525673f interpreterobjects: use typed_* for configuration_data.set*
This removes the ability to use ConfigurationData as a dict, but
restricting the inputs to `str | int | bool`. This may be a little too
soon for this, and we may want to wait on that part, it's only bee 8
months since we started warning about this.
2022-01-18 17:53:29 -05:00
Dylan Baker 1ff2abcd9c interpreterobjects: use typed_kwargs for dependency.get_variable 2022-01-18 17:53:29 -05:00
Dylan Baker 1751dc4701 interpreterobjects: use typed_kwargs for dependency.get_pkgconfig_variable 2022-01-18 17:53:29 -05:00
Dylan Baker ab9c0c1735 interpreterobjects: use typed_kwargs for FeatureOption.require 2022-01-18 17:53:29 -05:00
Dylan Baker fcced46c99 interpreter: use typed_kwargs for run_command
This also cleans up a couple of internal callers of the internal impl
version that don't set the `check` argument, and therefore trigger a
warning about not setting the check argument.
2021-11-29 18:12:33 -08:00
Dylan Baker c167a7691f interpreter: use typed_kwargs for find_program 2021-11-22 11:28:43 -08:00
Dylan Baker d05a0fbf33 interpreter: use typed_* args for the summary function
This also includes a few type annotation cleans for the Summary object.

Getting the positional arguments exactly right is impossible, as this is
really a function with two different signatures:
```
summary(value: dictionary): void
summary(key: string, value: any): void
```
We can get close enough in the typed_pos_args by enforcing that there
are two parameters, one required and one optional, and that the first
must be either a dictionary or a string.
2021-11-22 11:28:43 -08:00
Dylan Baker 3295621706 interpreter: add typed_kwargs to subdir 2021-11-22 11:28:43 -08:00
Dylan Baker f34013fb08 interpreter: use typed_kwargs for project 2021-11-22 11:28:43 -08:00
Dylan Baker ab29126232 interpreter: use typed_kwargs for add_test_setup
This also sets a few missing "new kwarg" warnings, as they're quite easy
to set with typwed_kwargs
2021-11-22 11:28:43 -08:00
Dylan Baker c3c30d4b06 interpreter: Use typed_kwargs for func_custom_target
This does not convert the build side, or remove any of the checking it
does. We still need that for other callers of custom target. What we'll
do for those is add an internal interface that defaults things, then
we'll be able to have those callers do their own validation, and the
CustomTarget validation machinary can be removed.

Fixes #9096
2021-09-30 21:01:38 +02:00
Dylan Baker 16986f1853 interpreter: DEPFILE_KW should be Optional[str] 2021-09-30 21:01:38 +02:00
Dylan Baker cb762f29fe interpreter: use typed_kwargs on func_run_target 2021-09-30 21:01:38 +02:00
Dylan Baker 3731e1d8f3 make EnvironmentVariablesObject a proper holder
Currently, EnvironmentVariablesObject is a strange
holder-that's-not-a-holder. This has implicaitons for things that expect
to get an EnvironmentVariables object, as we can't automatically
unholder it, and instead have to to manually do so. Now we can
automatically unholder it, which makes everything much nicer.
2021-08-30 18:05:02 -07:00
Dylan Baker 940fc372db interperter/kwargs: narrow type checking
Since the convertor has been added env, we are now only going to be an
EnvironmentVariables object, nothing else.
2021-08-30 18:05:02 -07:00
Tristan Partin 959e1bb2e3 Add typed_kwargs to add_languages() 2021-08-26 09:51:33 -07:00
Dylan Baker a1fb3199c8 interpreterobjects: Add TypedDict annoations for `extract_search_dirs`
This allows for more accurate type checking
2021-08-16 16:21:51 -07:00
Dylan Baker 09d7da19c1 interpreter: use typed_kwargs for include_directories 2021-07-07 11:21:03 -07:00
Dylan Baker bc4201a7f1 interpreter: add required and disabled to import
This is useful both from the perspective of optional functionality that
requires a module, and also as I continue to progress with Meson++,
which will probably not implement all of the modules that Meson itself
does.
2021-06-30 16:28:14 -07:00
Dylan Baker 7213b7d81f interpreter: use typed_kwargs for install_man 2021-06-22 09:13:41 -07:00
Dylan Baker f4d2efbed3 interpreter: use typed_kwargs for install_headers 2021-06-22 09:13:41 -07:00
Dylan Baker ea3d85a1c0 interpreter: use typed_kwargs for install_data 2021-06-22 09:13:41 -07:00
Dylan Baker 596c8d4af5 interpreter: use typed_kwargs for install_subdir 2021-06-22 09:12:54 -07:00
Daniel Mensinger 7c757dff71 holders: Fix the remaining code to respect the holder changes 2021-06-18 23:48:33 +02:00
Dylan Baker c422621317 interpreterobjects|build: use typed_kwargs for generator.process 2021-06-15 12:48:53 -07:00
Dylan Baker 491c756dc9 interpreter: use typed_kwargs for func_generator
Do the type checking in a nice tidy way
2021-06-15 12:48:53 -07:00
Dylan Baker 2bc7a1b3da modules/qt: fully annotate and check qt.has_tools 2021-06-15 12:36:05 -07:00
Dylan Baker e2266e8708 interpreter: use typed_*args for test and benchmark
this also requires some changes to the Rust module, as it calls into the
test code.
2021-06-14 12:30:02 -07:00
Dylan Baker 3f9a81e7f1 interpreter: use typed_kwargs for the add_*_arguments family
This makes use of the new convertor and validator arguments, so that we
can check that the languages passed are in fact vaild, and then convert
the native boolean into a MachineChoice internally.
2021-06-08 11:00:55 +02:00