Commit Graph

76 Commits

Author SHA1 Message Date
Daniel Mensinger 7c757dff71 holders: Fix the remaining code to respect the holder changes 2021-06-18 23:48:33 +02:00
Jussi Pakkanen 6fb2f86379
Merge pull request #8822 from dcbaker/submit/annotate-and-check-qt-module
Rewrite the Qt module for type safety!
2021-06-16 20:11:46 +03:00
Dylan Baker 3824e30f7a modules/qt: fix remaining typing issues and add to run_mypy
This just ignores the fact taht Generator is unchecked. Generator needs
some real love in terms of type checking.
2021-06-15 12:36:05 -07:00
Dylan Baker 2eabcae9b5 run_mypy: lower required version to 0.812
I've run this against Meson and it has no spurious errors. I suspect
that all versions >= .8 are fine, but I didn't test those.
2021-06-13 21:29:02 -07:00
Xavier Claessens 97bedd015f run_mypy: Check mypy version to avoid spurious errors 2021-06-11 23:03:43 +02:00
Daniel Mensinger ad584f022d interpreter: Move interpreterbase.py into a new package 2021-06-11 10:42:18 +02:00
Daniel Mensinger 7fc755b334 typing: Fully annotate run_project_tests.py 2021-06-09 13:25:36 +02:00
Daniel Mensinger 15b69d0421 typing: Fully annotate dependencies 2021-06-09 09:46:37 +02:00
Daniel Mensinger 30e329aac9 typing: Fully annotate dependencies.framework 2021-06-06 21:30:02 +03:00
Daniel Mensinger 25875ae0d3 typing: Fully annotate dependencies.{detect,factory} + some other fixes 2021-06-06 20:30:24 +03:00
Daniel Mensinger 71906c4bf8 typing: Fully annotate dependencies.cmake 2021-06-06 20:02:48 +03:00
Daniel Mensinger 125566b329 typing: Fully annotate dependencies.platform 2021-06-06 19:40:35 +03:00
Daniel Mensinger 96473085e0 typing: Fully annotate dependencies.dub 2021-06-06 19:40:35 +03:00
Daniel Mensinger 6798bc8146 typing: Fully annotate dependencies.pkgconfig 2021-06-06 01:34:49 +03:00
Daniel Mensinger 240434b167 typing: Fully annotate dependencies.cuda 2021-06-05 12:35:48 +02:00
Daniel Mensinger 969ee9d85b typing: Fully annotate dependencies.configtool 2021-06-05 11:57:01 +02:00
Daniel Mensinger 1d0bd562f1 typing: Fully annotate dependencies.coarrays 2021-06-05 11:57:01 +02:00
Daniel Mensinger df4d2bd247 typing: Fully annotate dependencies.base 2021-06-03 10:23:27 -07:00
Dylan Baker 8771045d79 dependencies/qt: Add type annotations
And fix some style and correctness issues
2021-03-22 16:53:51 -07:00
Dylan Baker 97c1283baa programs: add type annotations 2021-03-19 08:47:10 -04:00
Xavier Claessens 598e968993 Add `meson devenv` command and meson.add_devenv() 2021-03-16 09:00:50 -04:00
Dylan Baker 44c836e0d9 add a script to run a single test
As a Meson developer it's often frustrating to have a single functional
test with a regression. These tests can be awkward to reproduce,
especially when they make use of a test.json file. This script provides
a simmple interface to call functional tests 1 at a time, regardless of
whether they use a test.json or not. If they do use a test.json, and
have a matrix, then the `--subtest` option can be used to select spcific
combinations, for example:
```sh
./run_single_test.py "test cases/frameworks/15 llvm" --subtest 1
```
will run only the second (zero indexed of course) subtest from the llvm
test cases.

This is not a super elegent script, but this is super useful.
2021-02-23 09:08:55 -08:00
Dylan Baker 23d3b98fc1 split mesonlib into a package
Currently mesonlib does some import tricks to figure out whether it
needs to use windows or posix specific functions. This is a little
hacky, but works fine. However, the way the typing stubs are implemented
for the msvcrt and fnctl modules will cause mypy to fail on the other
platform, since the functions are not implemented.

To aleviate this (and for slightly cleaner design), I've split mesonlib
into a pacakge with three modules. A universal module contains all of
the platform agnositc code, a win32 module contains window specific
code, a posix module contains the posix specific code, and a platform
module contains no-op implementations. Then the package's __init__ file
imports all of the universal functions and all of the functions from the
approriate platform module, or the no-op versions as fallbacks. This
makes mypy happy, and avoids `if`ing all over the code to switch between
the platform specific code.
2021-01-23 12:48:29 +01:00
Dylan Baker 1849a9e9b7 run_mypy: add minstall 2021-01-13 13:32:48 -08:00
Dylan Baker 3d80a88bd3 modules: Add an unstable-rust module
Like other language specific modules this module is module for holding
rust specific helpers. This commit adds a test() function, which
simplifies using rust's internal unittest mechanism.

Rust tests are generally placed in the same code files as they are
testing, in contrast to languages like C/C++ and python which generally
place the tests in separate translation units. For meson this is
somewhat problematic from a repetition point of view, as the only
changes are generally adding --test, and possibly some dependencies.

The rustmod.test() method provides a mechanism to remove the repatition:
it takes a rust target, copies it, and then addes the `--test` option,
then creates a Test() target with the `rust` protocol. You can pass
additional dependencies via the `dependencies` keyword. This all makes
for a nice, DRY, test definition.
2021-01-05 15:10:50 -08:00
Jussi Pakkanen 3d009609fb
Merge pull request #8010 from dcbaker/submit/optinterpreter-cleanups
Opt Interpreter cleanups and type annotations
2020-11-22 04:30:26 +02: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
Dylan Baker 93ecfa646b Add type annotations to optinterpreter 2020-11-20 14:48:35 -08:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Dylan Baker 4cdc32114b run_mypy: mark the whole compilers package as type safe 2020-10-01 15:06:10 -07:00
Dylan Baker 6a9761a2c0 compilers/d: add type annotations 2020-10-01 15:06:10 -07:00
Dylan Baker e039727e63 compilers/fortran: add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker 3fc37fc13e compilers/java: Add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker 4430269d4e compilers/rust: add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker e437bdd0a9 compilers/swift: Add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker efceec9615 Compilers/vala: Add type annotations 2020-10-01 15:05:00 -07:00
Dylan Baker d3a059b55f compilers/cuda: make type safe 2020-10-01 15:05:00 -07:00
Dylan Baker fe97977b00 compilers/cpp: Add type annotations 2020-10-01 15:05:00 -07:00
Dylan Baker 96a1ae6dfe compilers: fully type annotate the C compilers 2020-10-01 15:05:00 -07:00
Daniel Mensinger 2f3ef6f1af
typing: fully annotate cmake.interpreter 2020-09-28 13:54:04 +02:00
Daniel Mensinger 9f695435e7
typing: add convinient option to clear the terminal to run_mypy.py 2020-09-27 11:21:36 +02:00
Daniel Mensinger 19b3f65e70
typing: fix indentation in run_mypy.py 2020-09-27 11:20:05 +02:00
Dylan Baker da4c1945fc compilers/objcpp: add type annotations 2020-09-24 12:14:13 -07:00
Dylan Baker 05df8320db compilers/objc: Add type annotations 2020-09-24 12:14:13 -07:00
Dylan Baker 02658fdda4 run_mypy: compilers/c_function_attributes is already type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 0d644ac87b run_mypy: all of compilers/mixins is now type safe 2020-09-24 12:14:13 -07:00
Dylan Baker fa1398f86c compilers/mixins: make xc16 type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 4911e8eef4 compilers/mixins: make visual studio type safe 2020-09-24 12:14:13 -07:00
Dylan Baker b6c8b8a5be compilers/mixins/pgi: Make type safe 2020-09-24 12:14:13 -07:00
Dylan Baker 6dc774f1b6 compilers/mixins/islinker: Make type safe 2020-09-24 12:14:13 -07:00