Mercurial > hg
changeset 43470:32ac4d0b4102
hghave: add a check for pytype, Google's Python type checker
I'm not unbiased, but I strongly prefer pytype to mypy: it does more
inference, so we don't need as many annontations. In theory we can use
both, but since I'm doing some tinkering with pytype I figured I'd
just try setting it up.
Differential Revision: https://phab.mercurial-scm.org/D7268
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 06 Nov 2019 14:09:36 -0500 |
parents | 5f2a8dabb0d8 |
children | 8492c6293c31 |
files | tests/hghave.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/hghave.py Wed Nov 06 15:13:23 2019 -0500 +++ b/tests/hghave.py Wed Nov 06 14:09:36 2019 -0500 @@ -1000,3 +1000,11 @@ version = matchoutput(blackcmd, version_regex) sv = distutils.version.StrictVersion return version and sv(_strpath(version.group(1))) >= sv('19.10b0') + + +@check('pytype', 'the pytype type checker') +def has_pytype(): + pytypecmd = 'pytype --version' + version = matchoutput(pytypecmd, b'[0-9a-b.]+') + sv = distutils.version.StrictVersion + return version and sv(_strpath(version.group(0))) >= sv('2019.10.17')