tree: 9d2dc06384d0ab9987c2edc8b95d70cdfef330a7 [path history] [tgz]
  1. .style.yapf
  2. OWNERS
  3. pytype_runner.py
  4. README.md
testing/pytype_common/README.md

This directory contains Python code for running pytype (a Python 3 type hinting analyzer) on Chromium Python code. pytype can infer types from un-annotated code, so it is not necessary to have type hinting added for all analyzed code and its dependencies. However, it is still recommended to do so eventually to ensure that the type hinting is as accurate as possible and to ensure that humans have up-to-date information about what functions take and return.

To run pytype, simply import pytype_runner.py and call its run_pytype function with the correct arguments as specified in its docstring.

It is recommended to NOT run this as part of presubmit, as depending on how many dependencies your code has, it can end up analyzing many files and taking multiple minutes. This time goes down dramatically once pytype has a cache built, but there is currently no way to ensure bots have a warm cache, so it should not be relied on.