Lines Matching full:mypy
40 # For type checking Python code, we also need mypy. This isn't
42 # so we don't pull the dependency in unless needed, and (2) mypy
72 # The files and directories on which we run the mypy typechecker. The paths are
135 """An invocation of mypy."""
144 """Finds the mypy executable and returns a command to invoke it.
146 If mypy cannot be found and we're inside the chroot, this
147 function installs mypy and returns a command to invoke it.
149 If mypy cannot be found and we're outside the chroot, this
154 - the command to invoke mypy, and
155 - any environment variables to set when invoking mypy
157 if has_executable_on_path("mypy"):
158 return MyPyInvocation(command=["mypy"], pythonpath_additions="")
165 rc, output = run_command_unchecked(pip + ["show", "mypy"])
178 "mypy",
189 subprocess.check_call(pip + ["install", "--user", "mypy"])
370 mypy: MyPyInvocation,
373 """Checks type annotations using mypy."""
375 if mypy.pythonpath_additions:
377 f"{mypy.pythonpath_additions}:{fixed_env['PYTHONPATH']}"
382 cmd = mypy.command + ["--version"]
389 output=f"Failed getting mypy version; stdstreams: {output}",
395 cmd = mypy.command + ["--follow-imports=silent"] + list(files)
549 mypy = get_mypy()
550 if not mypy:
553 output="mypy not found. Please either enter a chroot "
554 "or install mypy",
562 check_mypy, (toolchain_utils_root, mypy, to_check)