Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
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 | 2 | -1/+20 | |
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 | 2 | -1/+28 | |
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 | run_unittests.py: Use mock for monkey patching | Dylan Baker | 1 | -22/+20 | |
it's what mock is for afterall | |||||
2021-06-08 | run_unittests.sh: fix Python DeprecationWarning | Paolo Bonzini | 1 | -1/+1 | |
Fix the following Python error: D:\a\1\s\run_unittests.py:6654: DeprecationWarning: invalid escape sequence \ self.assertEqual(libhello_nolib.get_pkgconfig_variable(escaped_var, {}), hello world) Use a raw string literal. | |||||
2021-06-08 | interpreter: add feature.disable_auto_if() | Paolo Bonzini | 3 | -0/+24 | |
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 | 6 | -2/+57 | |
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 | Merge pull request #8706 from dcbaker/wip/2021-04/cython-language | Jussi Pakkanen | 25 | -33/+480 | |
1st class Cython language support | |||||
2021-06-07 | Fix macpkg generator import path. [skip ci] | Jussi Pakkanen | 1 | -1/+1 | |
2021-06-07 | cython: Add an option for selecting python 3 vs python 2 output | Dylan Baker | 2 | -5/+34 | |
2021-06-07 | docs: Add cython docs | Dylan Baker | 4 | -10/+65 | |
2021-06-07 | cython: Add a test for generated files | Dylan Baker | 6 | -0/+104 | |
2021-06-07 | cython: add 1 basic test | Dylan Baker | 8 | -2/+107 | |
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 | 2 | -14/+20 | |
2021-06-06 | typing: Fully annotate dependencies.{detect,factory} + some other fixes | Daniel Mensinger | 9 | -63/+104 | |
2021-06-06 | typing: Fully annotate dependencies.cmake | Daniel Mensinger | 2 | -59/+70 | |
2021-06-06 | typing: Fully annotate dependencies.platform | Daniel Mensinger | 2 | -3/+10 | |
2021-06-06 | typing: Fully annotate dependencies.dub | Daniel Mensinger | 2 | -18/+32 | |
2021-06-06 | typing: Fully annotate dependencies.pkgconfig | Daniel Mensinger | 2 | -26/+34 | |
2021-06-06 | Merge pull request #8796 from xclaesse/wrapdbv2 | Jussi Pakkanen | 6 | -52/+91 | |
wrap: Port to v2 protocol | |||||
2021-06-05 | docs: Generate a table of all wrapdb releases | Xavier Claessens | 3 | -0/+36 | |
wrapdb CI will trigger Meson's CI to regenerate the list when releases.json is updated. | |||||
2021-06-05 | typing: Fully annotate dependencies.cuda | Daniel Mensinger | 4 | -23/+40 | |
2021-06-05 | typing: mlog use StringProtocol | Daniel Mensinger | 2 | -2/+14 | |
2021-06-05 | typing: Fully annotate dependencies.configtool | Daniel Mensinger | 2 | -16/+24 | |
2021-06-05 | typing: Fully annotate dependencies.coarrays | Daniel Mensinger | 2 | -5/+6 | |
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 | 2 | -2/+24 | |
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 | 2 | -64/+65 | |
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 | 24 | -1859/+2059 | |
Split the Factory and dependency classes out of the base.py script to improve maintainability. | |||||
2021-06-02 | add a couple more type annotations | Dylan Baker | 2 | -2/+2 | |
2021-06-02 | build: Use ImmutableSetProtocol for lru_cache'd value | Dylan Baker | 1 | -2/+2 | |
To avoid mutation if possible. |