ancient-terabyte-9085
09/16/2023, 4:38 AMpants check my_package/::
and get a successful result, the a repeat of that call will return a cached result, but if I edit any file within my_package/::
, a new call to pants check
will run against all files again, even if the changed file is a leaf node in the larger dependency tree.
Is this the expected caching behavior of the Pyright backend? Are there plans to make it granular to each source file?broad-processor-92400
09/16/2023, 10:27 AMfile.py
has a from .sibling import function
import, then type checking file.py
needs sibling.py
, and thus changes to sibling.py
require type checking file.py
too (and for all transitive downstream code too)
So, the checking goals typically work at a whole-repo level. This can definitely be improved eg theoretically could happen in a vaguely per-file way, with appropriate support from pyright (since checking a file actually only needs the definitions from each import, doesn’t need to type check all their internal code)
For mypy, pants has support for getting mypy to use it’s own cache, so that rechecking a barely-changed repo is still pretty fast (not as fast as unchanged of course).
Does pyright have its own caching? If so, I don’t know if pants enables itancient-terabyte-9085
09/16/2023, 3:14 PMancient-terabyte-9085
09/16/2023, 3:15 PMenough-analyst-54434
09/16/2023, 3:47 PMpyright
command line tool (^ with no daemon, i.e. not using --watch
) that is faster, then it is probably possible and just needs more or less elbow grease since this is a volunteer driven project. It shouldn't be too hard to experiment with the pyright
CLI and find the answer to 1st order.
^ Pants does not have easy support for daemon tools right now that stay up and running between Pants runs.broad-processor-92400
09/17/2023, 11:28 PM