Commit Graph

156 Commits

Author SHA1 Message Date
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Eli Schwartz 4340bf34fa
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only --keep-percent-format"

and committing the results. I have not touched string formatting for
now.

- use set literals
- simplify .format() parameter naming
- remove __future__
- remove default "r" mode for open()
- use OSError rather than compatibility aliases
- remove stray parentheses in function(generator) scopes
2021-03-04 17:11:26 -05:00
Paolo Bonzini be0a05e777 mintro: include the correct target filenames for flat layout
Fixes: #8408
2021-03-04 17:36:41 +01:00
Paolo Bonzini 675bb2f340 mintro: fix flake8 issues 2021-03-04 17:36:41 +01:00
Xavier Claessens 2fabd4c7dc minstall: Add --skip-subprojects option
By default all subprojects are installed. If --skip-subprojects is given
with no value only the main project is installed. If --skip-subprojects
is given with a value, it should be a coma separated list of subprojects
to skip and all others will be installed.

Fixes: #2550.
2021-02-22 23:03:55 +02:00
Dylan Baker f14bf8b2ed mintro: fix mypy warning
The output of list_targets is a pretty horrific jumble of things. We
really need a TypeDict to make this not so terrible we can't deal with
it, so for now just use Any.
2021-01-04 12:20:59 -08:00
Dylan Baker a539fda0cf fix LGTM warnings 2021-01-04 12:20:59 -08:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
2021-01-04 12:20:58 -08:00
Dylan Baker 71db6b04a3 use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.

this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
2021-01-04 12:20:40 -08:00
Dylan Baker fe973d9fc4 use OptionKey for compiler_options 2021-01-04 12:20:39 -08:00
Dylan Baker 7142c92285 use OptionKey for backend_options 2021-01-04 12:15:41 -08:00
Dylan Baker e2ef6930ff use OptionKey for coredata.user_options 2021-01-04 12:15:41 -08:00
Paolo Bonzini 879e9d19f5 mintro: export functions to load the meson-info files
With the next patch, "meson test" will be using the targets introspection
information.  Provide helper functions to share bits of code between
mintro.py and mtest.py.
2020-12-14 10:42:32 +01:00
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Daniel Mensinger 7c377e5a5d intro: Add extra_files key to intro output (fixes #7310) 2020-10-15 01:56:59 +03:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Dylan Baker 6d173f9678 mesonlib: make OptionOverrideProxy a true MutableMapping
So that we can actually use it anyplace that an OptionDictType could be
used. I've also done a bit optimizing/simplifying of the implementation.
This is needed for cuda, as it returns an OptionOverrideProxy where we
ask for an OptionDicType
2020-10-01 15:05:00 -07:00
Daniel Mensinger e681235e5f
typing: fix code review 2020-09-08 20:15:58 +02:00
Daniel Mensinger 23818fc5a3
typing: more fixes 2020-09-08 20:15:58 +02:00
Daniel Mensinger 0490372449
typing: fully annotate mintro and mtest 2020-09-08 20:15:57 +02:00
Paolo Bonzini fa5c2363eb introspect: add test dependencies info to test/benchmark JSON
Add the ids of any target that needs to be rebuilt before running the
tests as computed by the backend, to the introspection data for tests and benchmarks.
This also includes anything that appears on the test's command line.

Without this information, IDEs must update the entire build before running
any test.  They can now instead selectively build the test executable
itself and anything that is needed to run it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-04 14:45:20 +02:00
Dylan Baker af763e093a mconf/mintro: use authoritative list of options from coredata
This splits the directory options and non-directory options into two
dicts, and then merges them later to maintain API.
2020-08-01 22:00:06 -07:00
TheQwertiest 365b667dc5 mintro: typings again x2
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-06-12 10:45:30 -07:00
TheQwertiest a8256e4900 mintro: more typing shenanigans 2020-06-12 10:45:30 -07:00
TheQwertiest b71e73fc64 mintro: typing fix 2020-06-12 10:45:30 -07:00
TheQwertiest a43e770071 mintro: typing fix 2020-06-12 10:45:30 -07:00
TheQwertiest f1288ac7ec mintro: enforced order for subcommands 2020-06-12 10:45:30 -07:00
TheQwertiest 2fe4c60ae3 Made --help options sorted 2020-06-09 13:57:44 -07:00
Daniel Mensinger 96eeef62ea
ast: Add AST JSON printer 2020-05-23 18:13:16 +02:00
Dylan Baker 28e3ce67ae Convert test protocol into an enum
This gives us better type safety, and will be important as we add more
test methods
2020-04-30 13:54:46 -07:00
John Ericson 278c294aa4 Compiler options per lang
A current rather untyped storage of options is one of the things that
contributes to the options code being so complex. This takes a small
step in synching down by storing the compiler options in dicts per
language.

Future work might be replacing the langauge strings with an enum, and
defaultdict with a custom struct, just like `PerMachine` and
`MachineChoice`.
2020-04-20 23:23:15 +03:00
Daniel Mensinger 4ce90bcb08 intro: List symlinks in installdata (fixes #6734) 2020-03-08 13:49:53 +02:00
Daniel Mensinger c14aea2812
types: Annotate mparser.py
This also fixes that the keys in ArgumentNode.kwargs are
all of the type BaseNode now. Before this commit, it was
possible that both strings and Nodes where used as keys.
2020-03-02 10:34:55 +01:00
Xavier Claessens 3ba0073df6 Make 'default_library' per-subproject builtin option
Currently it's just like if all builtin/base/compiler options are
yielding. This patch makes possible to have non-yielding builtin
options. The value in is overriden in this order:
 - Value from parent project
 - Value from subproject's default_options if set
 - Value from subproject() default_options if set
 - Value from command line if set
2020-02-06 14:11:24 -05:00
Daniel Mensinger d0c7b51693 mintro: use interpreter data for buildsystem-files (fixes #6390) 2020-01-28 21:18:25 +02:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Paolo Bonzini 3778a34979 mintro: include test protocol in introspection data 2019-12-13 00:47:10 +02:00
Daniel Mensinger fc800a2cb8 mintro: Add version key to --scan-dependencies (fixes #6287) 2019-12-10 20:17:21 +02:00
Daniel Mensinger 7065a697e3 types: Add type annotations to mintro.py 2019-12-07 21:34:30 +02:00
Daniel Mensinger e4a0ee205d lgtm: Fix redundant code 2019-12-05 00:22:10 +02:00
Daniel Mensinger c361181cd9
mintro: dependencies: added version key 2019-11-14 18:16:47 +01:00
Wolfgang Stöggl f037e7ef45 Fix typos found by codespell
- Typos were found by codespell v1.16.0
2019-11-06 09:55:30 -05:00
Aaron Plattner b626978dc6 Add missing newlines to "meson introspect" error
The lack of newlines in the print() statement for this error causes the result
to be jumbled and hard to read:

 $ ./meson.py introspect
 Current directory is not a meson build directory.Please specify a valid build dir or change the working directory to it.It is also possible that the build directory was generated with an oldmeson version. Please regenerate it in this case.

Add newlines so the message is more readable:

 $ ./meson.py introspect
 Current directory is not a meson build directory.
 Please specify a valid build dir or change the working directory to it.
 It is also possible that the build directory was generated with an old
 meson version. Please regenerate it in this case.
2019-10-18 00:48:00 +03:00
Peter Hutterer 4ebce2c3f2 Add test priorities to force test start order 2019-08-24 21:26:41 +03:00
Daniel Mensinger 3b3f53ab55 mintro: Fix section key in buildoptions
This reverts the changes to the `section` key for the
buildoptions and moves the machine choice into it's
own `machine` key.

With this commit the __undocumented__ breaking change
to the introspection format (introduced in 0.51.0) is
reverted and a new key is added instead.
2019-07-17 19:20:33 +03:00
Daniel Mensinger 54b1c43277 mintro: Add installed subdirs introspection (fixes #5556) 2019-07-01 11:28:54 -07:00
John Ericson af2d7af998 Per machine do 'build.' and '' option prefixes
See the docs/ changes for details.
2019-06-05 23:05:34 -04:00
Paolo Bonzini 9491878681 meson-introspect: do not include host environment in test/benchmark introspection
The host environment could change between the time "meson setup"
produces intro-tests.json, and the time "meson test" is run.
Including it only adds clutter to the introspection data.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-05-28 20:18:10 +03:00
Dylan Baker 146e97e974 Use dependency cache 2019-05-20 10:05:36 -07:00
John Ericson 4030e7cb7a UserOption no longer has a name field.
This avoids the duplication where the option is stored in a dict at its
name, and also contains its own name. In general, the maxim in
programming is things shouldn't know their own name, so removed the name
field just leaving the option's position in the dictionary as its name.
2019-05-15 14:21:47 +03:00