changeset 43352:14e3be17e5f5 stable

hghave: verify we have a black that is new enough for our format We require what is currently the absolute latest black, so let's be paranoid.
author Augie Fackler <augie@google.com>
date Wed, 30 Oct 2019 16:29:45 -0400
parents cb0d80831ee0
children fdc3af52305b
files tests/hghave.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Wed Oct 30 16:17:39 2019 -0400
+++ b/tests/hghave.py	Wed Oct 30 16:29:45 2019 -0400
@@ -1,5 +1,6 @@
 from __future__ import absolute_import, print_function
 
+import distutils.version
 import os
 import re
 import socket
@@ -982,7 +983,8 @@
 
 @check('black', 'the black formatter for python')
 def has_black():
-    # use that to actual black as soon as possible
     blackcmd = 'black --version'
-    version_regex = b'black, version \d'
-    return matchoutput(blackcmd, version_regex)
+    version_regex = b'black, version ([0-9a-b.]+)'
+    version = matchoutput(blackcmd, version_regex)
+    sv = distutils.version.StrictVersion
+    return version and sv(version.group(1)) >= sv('19.10b0')