D7295: pytype: add a (very slow) test that executes pytype

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sat Nov 23 12:48:19 EST 2019


durin42 added a comment.


  In D7295#110254 <https://phab.mercurial-scm.org/D7295#110254>, @mharbison72 wrote:
  
  > In D7295#107482 <https://phab.mercurial-scm.org/D7295#107482>, @indygreg wrote:
  >
  >> Since type checking is slow (but there are state files we can reuse to speed things up), we'll need to figure out how to make this work in CI. But I have no doubt we can figure something out. Out of curiosity, how long does pytype take to run in a clean source directory, without any state files?
  >
  > It takes 15-20 minutes on a 2018 Mac mini.  In addition to the disabled files here, I've disabled:
  >
  >   mercurial/httppeer.py
  >   mercurial/repoview.py
  >   mercurial/localrepo.py
  >   mercurial/revlog.py
  >   mercurial/merge.py
  >   mercurial/testing/storage.py
  >
  > But I've also added back these, and sprinkled various disable comments around:
  >
  >   mercurial/bundlerepo.py
  >   mercurial/error.py
  >   mercurial/exchange.py
  >   mercurial/policy.py
  >   mercurial/pycompat.py
  >   mercurial/scmwindows.py
  >   mercurial/windows.py
  >   mercurial/wireprotoframing.py
  >
  > Even with the state files, it seems to take 10-15 minutes or so.
  
  Ooh, can you send your extra suppressions? For the most part I've been tackling this as a side project when I'm waiting on compiles.
  
  As to doing individual files: that's well and good, and might be a viable approach for mypy. That said, my sense has been that mypy is faster and significantly less useful, since we don't get cross-file analysis of what's going on. I _think_ pytype gets faster as we add more annotations, so my rough thought thus far as been to try and get some subset of the codebase clean, transitively, and then try to start stamping some types on important functions and interfaces to constrain things. Where I'd _really_ like to get is to be able to migrate the `@command` decorators and friends to use strings instead of bytes, and be able to recommend typechecking as a way for extension authors to clean things up, but that'll take a while.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7295/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7295

To: durin42, #hg-reviewers, indygreg
Cc: mharbison72, dlax, indygreg, mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list