tests/hghave.py
changeset 51700 7f0cb9ee0534
parent 51691 3cb2b5b6626f
child 51704 550994128204
equal deleted inserted replaced
51699:bd1483fd7088 51700:7f0cb9ee0534
  1111     # 24.4, so we allow emacs 24.4, 24.5, and 25+ (24.5 was the last
  1111     # 24.4, so we allow emacs 24.4, 24.5, and 25+ (24.5 was the last
  1112     # 24 release)
  1112     # 24 release)
  1113     return matchoutput('emacs --version', b'GNU Emacs 2(4.4|4.5|5|6|7|8|9)')
  1113     return matchoutput('emacs --version', b'GNU Emacs 2(4.4|4.5|5|6|7|8|9)')
  1114 
  1114 
  1115 
  1115 
  1116 @check('black', 'the black formatter for python >=23.3.0')
  1116 @check('black', 'the black formatter for python (>= 20.8b1)')
  1117 def has_black():
  1117 def has_black():
  1118     blackcmd = 'black --version'
  1118     blackcmd = 'black --version'
  1119     version_regex = b'black, (?:version )?([0-9a-b.]+)'
  1119     version_regex = b'black, (?:version )?([0-9a-b.]+)'
  1120     version = matchoutput(blackcmd, version_regex)
  1120     version = matchoutput(blackcmd, version_regex)
  1121     sv = distutils.version.StrictVersion
  1121     sv = distutils.version.StrictVersion
  1122     return version and sv(_bytes2sys(version.group(1))) >= sv('23.3.0')
  1122     return version and sv(_bytes2sys(version.group(1))) >= sv('20.8b1')
  1123 
  1123 
  1124 
  1124 
  1125 @check('pytype', 'the pytype type checker')
  1125 @check('pytype', 'the pytype type checker')
  1126 def has_pytype():
  1126 def has_pytype():
  1127     pytypecmd = 'pytype --version'
  1127     pytypecmd = 'pytype --version'