From 9e2eb789871085db4c9e29355cabbc4cfe114478 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 17 Jun 2024 22:44:00 +0200 Subject: [PATCH] pyproject.toml: fix our mypy setup This allows proper typechecking in testcases via LSP servers. Based on https://github.com/cockpit-project/cockpit-podman/commit/d9c625814fd1 --- pyproject.toml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 67c7a58..8963df6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,23 @@ +[tool.mypy] +follow_imports = 'silent' # https://github.com/python-lsp/pylsp-mypy/issues/81 +scripts_are_modules = true # allow checking all scripts in one invocation +explicit_package_bases = true +mypy_path = 'test/common:test:bots' +exclude = [ + "bots" +] + +[[tool.mypy.overrides]] +ignore_missing_imports = true +module = [ + # run without bots checked out + "machine.*", + "testvm", + + # run without gobject-introspection + "gi.*", +] + [tool.ruff] exclude = [ ".git/",