Skip to content

Commit

Permalink
Use updated Levenshtein upstream with pypy compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Feb 27, 2023
1 parent 04deff5 commit 721a8d4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 112 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Requirements

- Python 3.7 or higher
- difflib
- `python-Levenshtein <https://github.com/ztane/python-Levenshtein/>`_ (optional, provides a 4-10x speedup in String
- `Levenshtein <https://pypi.org/project/Levenshtein/>`_ (optional, provides a 4-10x speedup in String
Matching, though may result in `differing results for certain cases <https://github.com/seatgeek/fuzzywuzzy/issues/128>`_)

For testing
Expand All @@ -29,7 +29,7 @@ Using PIP via PyPI
pip install thefuzz
or the following to install `python-Levenshtein` too
or the following to install `Levenshtein` too

.. code:: bash
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def open_file(fname):
author='Adam Cohen',
author_email='[email protected]',
packages=['thefuzz'],
extras_require={'speedup': ['python-levenshtein>=0.12']},
extras_require={'speedup': ['Levenshtein']},
url='https://github.com/seatgeek/thefuzz',
license="GPLv2",
classifiers=[
Expand Down
79 changes: 0 additions & 79 deletions thefuzz/StringMatcher.py

This file was deleted.

26 changes: 0 additions & 26 deletions thefuzz/StringMatcher.pyi

This file was deleted.

6 changes: 2 additions & 4 deletions thefuzz/fuzz.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/usr/bin/env python
import platform
import warnings

try:
from .StringMatcher import StringMatcher as SequenceMatcher
from Levenshtein.StringMatcher import StringMatcher as SequenceMatcher
except ImportError:
if platform.python_implementation() != "PyPy":
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
warnings.warn('Using slow pure-python SequenceMatcher. Run `pip install Levenshtein` to remove this warning')
from difflib import SequenceMatcher

from . import utils
Expand Down

0 comments on commit 721a8d4

Please sign in to comment.