Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2021-06-09 | typing: Fully annotate run_project_tests.py | Daniel Mensinger | 2 | -3/+3 | |
2021-06-09 | compilers: Fix missing functions in Compiler base class | Daniel Mensinger | 8 | -16/+21 | |
2021-06-09 | typing: Rename some variables | Daniel Mensinger | 8 | -45/+54 | |
2021-06-09 | typing: remove unused DependencyType | Daniel Mensinger | 2 | -2/+2 | |
2021-06-09 | typing: Fully annotate dependencies | Daniel Mensinger | 5 | -72/+76 | |
2021-06-08 | Merge pull request #8512 from bonzini/feature-methods | Jussi Pakkanen | 1 | -4/+46 | |
Utility methods for feature objects | |||||
2021-06-08 | interpreter: make helper methods protected | Dylan Baker | 1 | -15/+15 | |
They really aren't meant to be called outside of the interpreter itself, so don't expose them as public | |||||
2021-06-08 | interpreter: Add type annotations for the add_*_arguments helpers | Dylan Baker | 1 | -9/+8 | |
internally these all used a set of shared heleprs, add type annotations for those as well | |||||
2021-06-08 | build: fix type annotations fo project_*_args | Dylan Baker | 1 | -2/+2 | |
These are Dict[str, Dict[str, List[str]]], unlike global arguments because they must store the information per subproject | |||||
2021-06-08 | interpreter: use typed_kwargs for the add_*_arguments family | Dylan Baker | 2 | -20/+65 | |
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 | interpreter: use typed_pos_args for add_*_args | Dylan Baker | 1 | -12/+12 | |
This just replaces stringArgs with the typed_pos_args, and it's better error message. | |||||
2021-06-08 | intperperterbase: Add a convertor keyword argument | Dylan Baker | 1 | -1/+10 | |
This is meant to allow simple type conversions to happen before the interpreter function is called. This should simplify some cases like the "native" keyword arugment that are booleans in the Meson DSL, but an Enum in the implementation | |||||
2021-06-08 | interpreterbase: Add validator keyword argument to typed_kwargs | Dylan Baker | 1 | -1/+13 | |
This attribute is a callable that returns a string if the value is invalid, otherwise None. This intended for cases like the `install_*` function's `install_mode` paramater, which is either an int or the string "preserve", which allows us to do nice things like: ```python class Kwargs(TypedDict): install_mode: T.Union[int, T.Literal['preserve']] @typed_kwargs( 'foo', KwargInfo('install_mode', ..., validator=lambda x: None if isinstance(x, int) or x == 'preserve' else 'must be the literal "preserve"), ) def install_data(self, node, args, kwargs: 'Kwargs'): ... ``` In this case mypy *knows* that the string is preserve, as do we, and we can simply do tests like: ```python if kwargs['install_mode'] == 'preserve': ... else: # this is an int ``` | |||||
2021-06-08 | make all arguments to KwargInfo except name and type keyword only | Dylan Baker | 1 | -1/+2 | |
To make them easier to understand in practice | |||||
2021-06-08 | interpreter: add feature.disable_auto_if() | Paolo Bonzini | 1 | -0/+9 | |
Add a method to downgrade an option to disabled if it is not used. This is useful to avoid unnecessary search for dependencies; for example dep = dependency('dep', required: get_option('feature').disable_auto_if(not foo)) can be used instead of the more verbose and complex if get_option('feature').auto() and not foo then dep = dependency('', required: false) else dep = dependency('dep', required: get_option('feature')) endif or to avoid unnecessary dependency searches: dep1 = dependency('dep1', required: get_option('foo')) # dep2 is only used together with dep1 dep2 = dependency('dep2', required: get_option('foo').disable_auto_if(not dep1.found())) ``` Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | |||||
2021-06-08 | interpreter: add feature.require() | Paolo Bonzini | 1 | -2/+25 | |
Add a method to perform a logical AND on a feature object. The method also takes care of raising an error if 'enabled' is ANDed with false. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | |||||
2021-06-07 | another pyupgrade pass | Eli Schwartz | 1 | -3/+3 | |
2021-06-07 | upgrade percent formatted strings pyupgrade did not catch | Eli Schwartz | 3 | -19/+17 | |
2021-06-07 | condense lines | Eli Schwartz | 4 | -24/+12 | |
2021-06-07 | more f-strings everywhere | Eli Schwartz | 4 | -138/+117 | |
pyupgrade didn't catch many .format() methods which were too complex (e.g. multiline or applied to templates rather than string literals) | |||||
2021-06-07 | cython: Add an option for selecting python 3 vs python 2 output | Dylan Baker | 2 | -5/+34 | |
2021-06-07 | Add C compiler when using Cython | Dylan Baker | 2 | -3/+4 | |
Since cython transpiles to C. | |||||
2021-06-07 | ninjabackend: generate cython compilation rules | Dylan Baker | 1 | -0/+61 | |
2021-06-07 | ninjabackend: cython doesn't use a linker | Dylan Baker | 1 | -4/+1 | |
2021-06-07 | compilers: Add cython file suffixes | Dylan Baker | 2 | -0/+3 | |
2021-06-07 | environment: Add detection logic for cython | Dylan Baker | 1 | -0/+28 | |
2021-06-07 | compilers: Expose Cython compiler | Dylan Baker | 1 | -0/+2 | |
2021-06-07 | hack: compilers/cython: hardcode python 3 not 2 | Dylan Baker | 1 | -1/+2 | |
2021-06-07 | compilers: Add a cython Compiler | Dylan Baker | 1 | -0/+60 | |
2021-06-07 | build: Add type annotations for Generator | Dylan Baker | 1 | -14/+15 | |
They're not 100% complete, but it's mostly there. | |||||
2021-06-06 | typing: Fully annotate dependencies.framework | Daniel Mensinger | 1 | -14/+19 | |
2021-06-06 | typing: Fully annotate dependencies.{detect,factory} + some other fixes | Daniel Mensinger | 8 | -63/+101 | |
2021-06-06 | typing: Fully annotate dependencies.cmake | Daniel Mensinger | 1 | -59/+69 | |
2021-06-06 | typing: Fully annotate dependencies.platform | Daniel Mensinger | 1 | -3/+9 | |
2021-06-06 | typing: Fully annotate dependencies.dub | Daniel Mensinger | 1 | -18/+31 | |
2021-06-06 | typing: Fully annotate dependencies.pkgconfig | Daniel Mensinger | 1 | -26/+33 | |
2021-06-06 | Merge pull request #8796 from xclaesse/wrapdbv2 | Jussi Pakkanen | 3 | -52/+55 | |
wrap: Port to v2 protocol | |||||
2021-06-05 | typing: Fully annotate dependencies.cuda | Daniel Mensinger | 3 | -23/+39 | |
2021-06-05 | typing: mlog use StringProtocol | Daniel Mensinger | 2 | -2/+14 | |
2021-06-05 | typing: Fully annotate dependencies.configtool | Daniel Mensinger | 1 | -16/+23 | |
2021-06-05 | typing: Fully annotate dependencies.coarrays | Daniel Mensinger | 1 | -5/+5 | |
2021-06-04 | dependencies/detect: Add type annotations to find_external_dependency | Dylan Baker | 1 | -4/+5 | |
2021-06-04 | interpreterobjects: Fix type annotation for CustomTargetHolder | Dylan Baker | 1 | -1/+1 | |
2021-06-04 | build: Add a type annotation to CustomTarget | Dylan Baker | 1 | -1/+1 | |
2021-06-04 | interpreterbase: Allow safely using mutable default values with typed_kwargs | Dylan Baker | 1 | -2/+13 | |
It's really inconvenient to want a thing that is always a list, but not be able to provide a default value of a list because of mutation. To that end the typed_kwargs method now makes a shallow copy of the default when using a `ContainerTypeInfo` as the type. This mean that using a default of `[]` is perfectly safe. | |||||
2021-06-04 | interpreterbase: fix type annotations for typed_pos_args | Dylan Baker | 1 | -2/+2 | |
It takes a tuple of any length, for optargs and varargs, not a tuple of length 1 | |||||
2021-06-04 | wrap: Port to v2 protocol | Xavier Claessens | 3 | -52/+55 | |
Fixes: #8754. | |||||
2021-06-03 | typing: Fully annotate dependencies.base | Daniel Mensinger | 1 | -64/+64 | |
2021-06-03 | typing: mlog: Simplify some typing with a TV_ variables | Daniel Mensinger | 1 | -13/+15 | |
2021-06-03 | deps: Split dependencies.base | Daniel Mensinger | 23 | -1857/+2055 | |
Split the Factory and dependency classes out of the base.py script to improve maintainability. |