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

login
register
mail settings
Submitter Rishabh Madan
Date July 18, 2017, 12:40 p.m.
Message ID <6bfef60b45ba91e170d2.1500381619@bunty>
Download mbox | patch
Permalink /patch/22479/
State Superseded
Headers show

Comments

Rishabh Madan - July 18, 2017, 12:40 p.m.
# HG changeset patch
# User Rishabh Madan <rishabhmadan96@gmail.com>
# Date 1500373628 -19800
#      Tue Jul 18 15:57:08 2017 +0530
# Node ID 6bfef60b45ba91e170d21ea31af60bb5062007db
# Parent  d8997d12840aa113cde7ffa0ea7af8d62cf1add7
releasenotes: add import check for fuzzywuzzy

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

Patch

diff -r d8997d12840a -r 6bfef60b45ba tests/hghave.py
--- a/tests/hghave.py	Tue Jul 18 15:22:34 2017 +0530
+++ b/tests/hghave.py	Tue Jul 18 15:57:08 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