aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-09tests: Reduce complexity of the run_tests signatureDaniel Mensinger2-40/+27
2021-06-09tests: reduce global variablesDaniel Mensinger1-26/+24
2021-06-09typing: Fully annotate run_project_tests.pyDaniel Mensinger6-108/+148
2021-06-09compilers: Fix missing functions in Compiler base classDaniel Mensinger8-16/+21
2021-06-09typing: Rename some variablesDaniel Mensinger8-45/+54
2021-06-09typing: remove unused DependencyTypeDaniel Mensinger2-2/+2
2021-06-09typing: Fully annotate dependenciesDaniel Mensinger6-88/+77
2021-06-08docs: fix issues with the cython docsDylan Baker2-5/+5
2021-06-08document the enhancement to the Fs module permitting File argumentsEli Schwartz2-3/+14
Add a release notes snippet too!
2021-06-08doc: Fix link to Commands.mdXavier Claessens1-1/+1
2021-06-08Merge pull request #8512 from bonzini/feature-methodsJussi Pakkanen7-5/+99
Utility methods for feature objects
2021-06-08interpreter: make helper methods protectedDylan Baker1-15/+15
They really aren't meant to be called outside of the interpreter itself, so don't expose them as public
2021-06-08interpreter: Add type annotations for the add_*_arguments helpersDylan Baker1-9/+8
internally these all used a set of shared heleprs, add type annotations for those as well
2021-06-08build: fix type annotations fo project_*_argsDylan Baker1-2/+2
These are Dict[str, Dict[str, List[str]]], unlike global arguments because they must store the information per subproject
2021-06-08interpreter: use typed_kwargs for the add_*_arguments familyDylan Baker2-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-08interpreter: use typed_pos_args for add_*_argsDylan Baker1-12/+12
This just replaces stringArgs with the typed_pos_args, and it's better error message.
2021-06-08intperperterbase: Add a convertor keyword argumentDylan Baker2-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-08interpreterbase: Add validator keyword argument to typed_kwargsDylan Baker2-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-08make all arguments to KwargInfo except name and type keyword onlyDylan Baker1-1/+2
To make them easier to understand in practice
2021-06-08run_unittests.py: Use mock for monkey patchingDylan Baker1-22/+20
it's what mock is for afterall
2021-06-08run_unittests.sh: fix Python DeprecationWarningPaolo Bonzini1-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-08interpreter: add feature.disable_auto_if()Paolo Bonzini3-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-08interpreter: add feature.require()Paolo Bonzini6-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-07another pyupgrade passEli Schwartz1-3/+3
2021-06-07upgrade percent formatted strings pyupgrade did not catchEli Schwartz3-19/+17
2021-06-07condense linesEli Schwartz4-24/+12
2021-06-07more f-strings everywhereEli Schwartz4-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-07Merge pull request #8706 from dcbaker/wip/2021-04/cython-languageJussi Pakkanen25-33/+480
1st class Cython language support
2021-06-07Fix macpkg generator import path. [skip ci]Jussi Pakkanen1-1/+1
2021-06-07cython: Add an option for selecting python 3 vs python 2 outputDylan Baker2-5/+34
2021-06-07docs: Add cython docsDylan Baker4-10/+65
2021-06-07cython: Add a test for generated filesDylan Baker6-0/+104
2021-06-07cython: add 1 basic testDylan Baker8-2/+107
2021-06-07Add C compiler when using CythonDylan Baker2-3/+4
Since cython transpiles to C.
2021-06-07ninjabackend: generate cython compilation rulesDylan Baker1-0/+61
2021-06-07ninjabackend: cython doesn't use a linkerDylan Baker1-4/+1
2021-06-07compilers: Add cython file suffixesDylan Baker2-0/+3
2021-06-07environment: Add detection logic for cythonDylan Baker1-0/+28
2021-06-07compilers: Expose Cython compilerDylan Baker1-0/+2
2021-06-07hack: compilers/cython: hardcode python 3 not 2Dylan Baker1-1/+2
2021-06-07compilers: Add a cython CompilerDylan Baker1-0/+60
2021-06-07build: Add type annotations for GeneratorDylan Baker1-14/+15
They're not 100% complete, but it's mostly there.
2021-06-06typing: Fully annotate dependencies.frameworkDaniel Mensinger2-14/+20
2021-06-06typing: Fully annotate dependencies.{detect,factory} + some other fixesDaniel Mensinger9-63/+104
2021-06-06typing: Fully annotate dependencies.cmakeDaniel Mensinger2-59/+70
2021-06-06typing: Fully annotate dependencies.platformDaniel Mensinger2-3/+10
2021-06-06typing: Fully annotate dependencies.dubDaniel Mensinger2-18/+32
2021-06-06typing: Fully annotate dependencies.pkgconfigDaniel Mensinger2-26/+34
2021-06-06Merge pull request #8796 from xclaesse/wrapdbv2Jussi Pakkanen6-52/+91
wrap: Port to v2 protocol
2021-06-05docs: Generate a table of all wrapdb releasesXavier Claessens3-0/+36
wrapdb CI will trigger Meson's CI to regenerate the list when releases.json is updated.