diff --git a/.travis.yml b/.travis.yml index 5e0e522..ac02e4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ os: linux language: python cache: pip -dist: xenial +dist: bionic python: - "3.5" - "3.6" diff --git a/setup.py b/setup.py index 1c16e43..3a5ef8d 100644 --- a/setup.py +++ b/setup.py @@ -61,6 +61,6 @@ setup( }, extras_require={ 'taxii': ['taxii2-client'], - 'semantic': ['haversine', 'fuzzywuzzy'], + 'semantic': ['haversine', 'rapidfuzz'], }, ) diff --git a/stix2/environment.py b/stix2/environment.py index 5ba82e9..24cfd79 100644 --- a/stix2/environment.py +++ b/stix2/environment.py @@ -364,8 +364,8 @@ def partial_string_based(str1, str2): float: Number between 0.0 and 1.0 depending on match criteria. """ - from fuzzywuzzy import fuzz - result = fuzz.token_sort_ratio(str1, str2, force_ascii=False) + from rapidfuzz import fuzz + result = round(fuzz.token_sort_ratio(str1, str2)) logger.debug("--\t\tpartial_string_based '%s' '%s'\tresult: '%s'", str1, str2, result) return result / 100.0 diff --git a/tox.ini b/tox.ini index 857414f..f938f8d 100644 --- a/tox.ini +++ b/tox.ini @@ -9,9 +9,8 @@ deps = pytest-cov coverage taxii2-client - fuzzywuzzy + rapidfuzz haversine - python-Levenshtein medallion commands = python -m pytest --cov=stix2 stix2/test/ --cov-report term-missing -W ignore::stix2.exceptions.STIXDeprecationWarning