Patchwork [2,of,3,v5] releasenotes: add import check for fuzzywuzzy

login
register
mail settings
Submitter Rishabh Madan
Date July 18, 2017, 6:02 p.m.
Message ID <7cb7831468b723f4315f.1500400966@bunty>
Download mbox | patch
Permalink /patch/22502/
State Superseded
Headers show

Comments

Rishabh Madan - July 18, 2017, 6:02 p.m.
# HG changeset patch
# User Rishabh Madan <rishabhmadan96@gmail.com>
# Date 1500399560 -19800
#      Tue Jul 18 23:09:20 2017 +0530
# Node ID 7cb7831468b723f4315f41358418435ff04c763b
# Parent  39eefb5c60a72f1201454c85dacf378da9e2f70c
releasenotes: add import check for fuzzywuzzy

This patch adds the has_fuzzywuzzy for import check of external dependency
fuzzywuzzy.

Patch

diff -r 39eefb5c60a7 -r 7cb7831468b7 tests/hghave.py
--- a/tests/hghave.py	Tue Jul 18 23:04:08 2017 +0530
+++ b/tests/hghave.py	Tue Jul 18 23:09:20 2017 +0530
@@ -658,3 +658,12 @@ 
 @check("fsmonitor", "running tests with fsmonitor")
 def has_fsmonitor():
     return 'HGFSMONITOR_TESTS' in os.environ
+
+@check("fuzzywuzzy", "Fuzzy string matching library")
+def has_fuzzywuzzy():
+    try:
+        import fuzzywuzzy
+        fuzzywuzzy.__version__
+        return True
+    except ImportError:
+        return False