aboutsummaryrefslogtreecommitdiff
path: root/run_mypy.py
AgeCommit message (Collapse)AuthorFilesLines
2024-09-06run_mypy: register utils/vsenv.py, as it is type-safeEli Schwartz1-0/+1
2024-09-06machinefile: Make fully typesafeDylan Baker1-0/+3
With the use of `typing_extensions.TypeAlias` we can get recursive types, which solves most of the issues we had with this file.
2024-07-16unittests: Add type annotations to the helpers moduleDylan Baker1-0/+1
2024-04-09modules: rename qt.py -> _qt.pyDylan Baker1-1/+1
Since it's an implementation detail, and shouldn't be exposed. This also helps give better error messages when a user writes `import('qt')`, since otherwise you get an error about `qt doesn't have an initialize method`, and now you get `qt module doesn't exist`.
2024-04-08meson format commandCharles Brunet1-0/+1
2024-02-12cuda module: fully type annotateEli Schwartz1-0/+1
Special notes: - _nvcc_arch_flags is always called with exact arguments, no need for default values - min_driver_version has its args annotation loosened because it has to fit the constraints of the module interface?
2024-01-08ast/introspection: make mypy cleanDylan Baker1-0/+1
2024-01-08ast: mark visitor and preprocessor as mypy safeDylan Baker1-0/+2
They already are warning free
2024-01-08ast/printer: fix mypy issuesDylan Baker1-0/+1
Other than one case that I think cannot be actually hit (or it would fail).
2023-12-11backends: correct nonebackend return annotation and check in run_mypyEli Schwartz1-0/+1
The only backend that can return values in generate() is ninja, so this was useless cruft.
2023-11-26run_mypy: avoid type-checking tools against every possible python versionEli Schwartz1-2/+9
2023-10-09Add simd.py to run_mypy.pyTristan Partin1-0/+1
2023-08-18run_mypy: add option to run once for each supported version of pythonEli Schwartz1-2/+10
This allows verifying that meson is type-safe under older versions of Python, which it currently is. Different versions of Python sometimes have different supported types for an API. Verify this in CI. (We flush output to ensure CI prints lines in the right order.)
2023-07-25mypy: add templates to checked modulesDylan Baker1-0/+1
2023-06-25fully type mconf.pyEli Schwartz1-0/+1
2023-06-25fully type mdist.pyEli Schwartz1-0/+1
2023-06-07cargo: Add a builder module to the cargo packageDylan Baker1-0/+1
This is a helper, currently only used by cargo. It could be moved later if there are other users.
2023-03-02run_mypy: accept the path to an alternative mypy executableEli Schwartz1-4/+3
mypy might be installed with a different python than the one run_mypy.py is using.
2023-03-02Revert "target python 3.10 as the mypy language version"Eli Schwartz1-1/+1
This reverts commit 0b7d935a846b8f2aa33b4e0d19fd7b4423d35df4. The issue is fixed in mypy 1.0.0 now.
2023-03-02run_mypy: passthrough unknown options to mypy itselfEli Schwartz1-2/+1
Useful for running as a thin wrapper in other contexts that expect the ability to run mypy itself with arbitrary arguments.
2023-01-16properly type utils/core.py and add it to mypyEli Schwartz1-0/+1
EnvironmentVariables was always broken, it used MutableMapping because everyone <3 abstract interfaces, especially when they are broken and don't actually do what you want. This needs a dict interface, exposing `.copy()`. We either use a dict or os._Environ, and the latter also supports that. Also fix a broken import, and the fallout from forgetting to update the signature of self.envvars in commit b926374205bd761085031755c87152d08bc10e9d.
2023-01-10modules: fully type the Qt* modulesDylan Baker1-0/+3
The base module is fully typed, but the numbered version are not, though it's pretty trivial to do so.
2023-01-10modules: add type annotations to the `__init__` moduleDylan Baker1-0/+1
2022-11-06target python 3.10 as the mypy language versionEli Schwartz1-1/+1
mypy has a bug when running on/for 3.11 which results in incorrect analysis of the codebase, specifically due to enum.Enum's self.name See: https://github.com/python/typeshed/issues/7564 https://github.com/python/mypy/issues/12483
2022-10-24run_mypy: add extra logging and permit specifying files to checkEli Schwartz1-15/+36
If those files are not yet known to be typed, skip them. This makes it possible to trivially check a shortlist of files that were just changed and see if they regress our mypy coverage. Ideal for use in a git pre-commit hook.
2022-09-28Move classes used by scripts to their own moduleXavier Claessens1-4/+4
Those classes are used by wrapper scripts and we should not have to import the rest of mesonlib, build.py, and all their dependencies for that. This renames mesonlib/ directory to utils/ and add a mesonlib.py module that imports everything from utils/ to not have to change `import mesonlib` everywhere. It allows to import utils.core without importing the rest of mesonlib.
2022-08-18run_mypy: Add modules/pkgconfig to the list of checked modulesDylan Baker1-0/+1
2022-08-17interpreter: move handling of module stability to interpreterDylan Baker1-4/+4
Thanks to `ModuleInfo`, all modules are just named `foo.py` instead of `unstable_foo.py`, which simplifies the import method a bit. This also allows for accurate FeatureNew/FeatureDeprecated use, as we know when the module was added and if/when it was stabilized.
2022-07-17modules/wayland: Add full type checkingDylan Baker1-0/+1
2022-05-23modules/icestorm: use type checkingDylan Baker1-0/+1
2022-05-23modules: add typing to the modtest moduleDylan Baker1-0/+1
2022-03-01use a more sane check instead of run_custom_lintEli Schwartz1-1/+0
Unfortunately, checking for strings without context is exceedingly prone to false positives, while missing anything that indirectly opens a file. Python 3.10 has a feature to warn about this though -- and it uses a runtime check which runs at the same time that the code fails to open files in the broken Windows locale. Set this up automatically when running the testsuite. Sadly, Python's builtin feature to change the warning level, e.g. by setting EncodingWarning to error at startup, is utterly broken if you want to limit it to only certain modules. This is tracked in order to be more efficiently ignored at https://bugs.python.org/issue34624 and https://github.com/python/cpython/pull/9358 It is also very trigger happy and passing stuff around via environment variable either messes with the testsuite, or with thirdparty programs which are implemented in python *such as lots of gnome*, or perhaps both. Instead, add runtime code to meson itself, to add a hidden "feature". In the application source code, running the 'warnings' module, you can actually get the expected behavior that $PYTHONWARNINGS doesn't have. So check for a magic testsuite variable every time meson starts up, and if it does, then go ahead and initialize a warnings filter that makes EncodingWarning fatal, but *only* when triggered via Meson and not arbitrary subprocess scripts.
2022-02-23run_mypy: add sourceset moduleDylan Baker1-0/+1
2022-01-18run_mypy: add gnome moduleDylan Baker1-0/+1
2022-01-10depfile: type annotateDylan Baker1-0/+1
2021-11-28Merge pull request #9623 from dcbaker/submit/keyval-typeingJussi Pakkanen1-0/+1
Add type annotations and typed_pos_args to the keyval module
2021-11-28Add typing to msubprojects.pyTristan Partin1-0/+1
2021-11-23run_mypy: add modules/keyvalDylan Baker1-0/+1
2021-10-09modules/windows: use typed_kwargsDylan Baker1-0/+1
2021-10-04run_mypy: Add the external_project_moduleDylan Baker1-0/+1
2021-10-03docs: Initial reference manual generatorDaniel Mensinger1-1/+3
2021-09-30modules/i18n: Fix remaining mypy spotted issuesDylan Baker1-1/+2
2021-09-24interpreter/mesonmain: Fix remaining typing problems and add to run_mypyDylan Baker1-0/+1
2021-08-31interpreter: Add IntegerHolderDaniel Mensinger1-0/+1
2021-08-22Add Java moduleTristan Partin1-0/+1
The Java module will serve as a source for easing Java development within Meson. Currently it only supports generating native header files.
2021-08-20run_mypy: add backends/backendsDylan Baker1-0/+1
2021-08-16run_mypy: add interpreter/compiler.pyDylan Baker1-0/+1
2021-08-04run_mypy: Add interpreter/type_checking to the list of checked modulesDylan Baker1-0/+1
2021-06-29tests: test that we always set encodingDaniel Mensinger1-1/+1
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-0/+1