Mercurial > hg
comparison tests/hghave.py @ 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 | 6792da448437 |
children | 21e05aabef8c |
comparison
equal
deleted
inserted
replaced
43469:5f2a8dabb0d8 | 43470:32ac4d0b4102 |
---|---|
998 blackcmd = 'black --version' | 998 blackcmd = 'black --version' |
999 version_regex = b'black, version ([0-9a-b.]+)' | 999 version_regex = b'black, version ([0-9a-b.]+)' |
1000 version = matchoutput(blackcmd, version_regex) | 1000 version = matchoutput(blackcmd, version_regex) |
1001 sv = distutils.version.StrictVersion | 1001 sv = distutils.version.StrictVersion |
1002 return version and sv(_strpath(version.group(1))) >= sv('19.10b0') | 1002 return version and sv(_strpath(version.group(1))) >= sv('19.10b0') |
1003 | |
1004 | |
1005 @check('pytype', 'the pytype type checker') | |
1006 def has_pytype(): | |
1007 pytypecmd = 'pytype --version' | |
1008 version = matchoutput(pytypecmd, b'[0-9a-b.]+') | |
1009 sv = distutils.version.StrictVersion | |
1010 return version and sv(_strpath(version.group(0))) >= sv('2019.10.17') |