equal
deleted
inserted
replaced
1 from __future__ import absolute_import, print_function |
1 from __future__ import absolute_import, print_function |
2 |
2 |
|
3 import distutils.version |
3 import os |
4 import os |
4 import re |
5 import re |
5 import socket |
6 import socket |
6 import stat |
7 import stat |
7 import subprocess |
8 import subprocess |
980 return matchoutput('emacs --version', b'GNU Emacs 2(4.4|4.5|5|6|7|8|9)') |
981 return matchoutput('emacs --version', b'GNU Emacs 2(4.4|4.5|5|6|7|8|9)') |
981 |
982 |
982 |
983 |
983 @check('black', 'the black formatter for python') |
984 @check('black', 'the black formatter for python') |
984 def has_black(): |
985 def has_black(): |
985 # use that to actual black as soon as possible |
|
986 blackcmd = 'black --version' |
986 blackcmd = 'black --version' |
987 version_regex = b'black, version \d' |
987 version_regex = b'black, version ([0-9a-b.]+)' |
988 return matchoutput(blackcmd, version_regex) |
988 version = matchoutput(blackcmd, version_regex) |
|
989 sv = distutils.version.StrictVersion |
|
990 return version and sv(version.group(1)) >= sv('19.10b0') |