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

login
register
mail settings
Submitter Rishabh Madan
Date July 3, 2017, 9:06 p.m.
Message ID <6684514628b44e838f49.1499115990@bunty>
Download mbox | patch
Permalink /patch/21957/
State Superseded
Headers show

Comments

Rishabh Madan - July 3, 2017, 9:06 p.m.
# HG changeset patch
# User Rishabh Madan <rishabhmadan96@gmail.com>
# Date 1499115118 -7200
#      Mon Jul 03 22:51:58 2017 +0200
# Node ID 6684514628b44e838f499b2125ffebe8d700a204
# Parent  5c9ad50fd62fbc2057ef7b44f921f22e7359af32
releasenotes: add import check for fuzzywuzzy

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

Patch

diff -r 5c9ad50fd62f -r 6684514628b4 tests/hghave.py
--- a/tests/hghave.py	Wed Jun 28 13:32:36 2017 +0200
+++ b/tests/hghave.py	Mon Jul 03 22:51:58 2017 +0200
@@ -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