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

login
register
mail settings
Submitter Rishabh Madan
Date July 9, 2017, 9:45 p.m.
Message ID <43c97ccdfd39cfa44710.1499636724@bunty>
Download mbox | patch
Permalink /patch/22182/
State Accepted
Headers show

Comments

Rishabh Madan - July 9, 2017, 9:45 p.m.
# HG changeset patch
# User Rishabh Madan <rishabhmadan96@gmail.com>
# Date 1499635502 -7200
#      Sun Jul 09 23:25:02 2017 +0200
# Node ID 43c97ccdfd39cfa447100b54e923d1d3d753476b
# Parent  5f22d3d43d36d46cea98c86b2a49eee2d323fd9e
releasenotes: add import check for fuzzywuzzy

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

Patch

diff -r 5f22d3d43d36 -r 43c97ccdfd39 tests/hghave.py
--- a/tests/hghave.py	Sun Jul 09 19:04:10 2017 +0200
+++ b/tests/hghave.py	Sun Jul 09 23:25:02 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