summaryrefslogtreecommitdiff
path: root/run_mypy.py
AgeCommit message (Collapse)Author
2023-08-18run_mypy: add option to run once for each supported version of pythonEli Schwartz
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 Baker
2023-06-25fully type mconf.pyEli Schwartz
2023-06-25fully type mdist.pyEli Schwartz
2023-06-07cargo: Add a builder module to the cargo packageDylan Baker
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 Schwartz
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 Schwartz
This reverts commit 0b7d935a846b8f2aa33b4e0d19fd7b4423d35df4. The issue is fixed in mypy 1.0.0 now.
2023-03-02run_mypy: passthrough unknown options to mypy itselfEli Schwartz
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 Schwartz
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 Baker
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 Baker
2022-11-06target python 3.10 as the mypy language versionEli Schwartz
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 Schwartz
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 Claessens
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 Baker
2022-08-17interpreter: move handling of module stability to interpreterDylan Baker
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 Baker
2022-05-23modules/icestorm: use type checkingDylan Baker
2022-05-23modules: add typing to the modtest moduleDylan Baker
2022-03-01use a more sane check instead of run_custom_lintEli Schwartz
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 Baker
2022-01-18run_mypy: add gnome moduleDylan Baker
2022-01-10depfile: type annotateDylan Baker
2021-11-28Merge pull request #9623 from dcbaker/submit/keyval-typeingJussi Pakkanen
Add type annotations and typed_pos_args to the keyval module
2021-11-28Add typing to msubprojects.pyTristan Partin
2021-11-23run_mypy: add modules/keyvalDylan Baker
2021-10-09modules/windows: use typed_kwargsDylan Baker
2021-10-04run_mypy: Add the external_project_moduleDylan Baker
2021-10-03docs: Initial reference manual generatorDaniel Mensinger
2021-09-30modules/i18n: Fix remaining mypy spotted issuesDylan Baker
2021-09-24interpreter/mesonmain: Fix remaining typing problems and add to run_mypyDylan Baker
2021-08-31interpreter: Add IntegerHolderDaniel Mensinger
2021-08-22Add Java moduleTristan Partin
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 Baker
2021-08-16run_mypy: add interpreter/compiler.pyDylan Baker
2021-08-04run_mypy: Add interpreter/type_checking to the list of checked modulesDylan Baker
2021-06-29tests: test that we always set encodingDaniel Mensinger
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger
2021-06-25linkers: move linkers.py into the linkers packageDaniel Mensinger
2021-06-18holders: Fix the remaining code to respect the holder changesDaniel Mensinger
2021-06-16Merge pull request #8822 from dcbaker/submit/annotate-and-check-qt-moduleJussi Pakkanen
Rewrite the Qt module for type safety!
2021-06-15modules/qt: fix remaining typing issues and add to run_mypyDylan Baker
This just ignores the fact taht Generator is unchecked. Generator needs some real love in terms of type checking.
2021-06-13run_mypy: lower required version to 0.812Dylan Baker
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-11run_mypy: Check mypy version to avoid spurious errorsXavier Claessens
2021-06-11interpreter: Move interpreterbase.py into a new packageDaniel Mensinger
2021-06-09typing: Fully annotate run_project_tests.pyDaniel Mensinger
2021-06-09typing: Fully annotate dependenciesDaniel Mensinger
2021-06-06typing: Fully annotate dependencies.frameworkDaniel Mensinger
2021-06-06typing: Fully annotate dependencies.{detect,factory} + some other fixesDaniel Mensinger
2021-06-06typing: Fully annotate dependencies.cmakeDaniel Mensinger