1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 pytestCheckHook,
7 hypothesis,
8 levenshtein,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "thefuzz";
14 version = "0.22.1";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-cTgDmn7PVA2jI3kthZLvmQKx1563jBR9TyBmTeefNoA=";
22 };
23
24 # Skip linting
25 postPatch = ''
26 substituteInPlace test_thefuzz.py \
27 --replace-fail "import pycodestyle" ""
28 '';
29
30 build-system = [ setuptools ];
31
32 dependencies = [ levenshtein ];
33
34 nativeCheckInputs = [
35 hypothesis
36 pytestCheckHook
37 ];
38
39 optional-dependencies = {
40 speedup = [ ];
41 };
42
43 pythonImportsCheck = [ "thefuzz" ];
44
45 disabledTests = [
46 # Skip linting
47 "test_pep8_conformance"
48 ];
49
50 meta = with lib; {
51 description = "Fuzzy string matching for Python";
52 homepage = "https://github.com/seatgeek/thefuzz";
53 changelog = "https://github.com/seatgeek/thefuzz/blob/${version}/CHANGES.rst";
54 license = licenses.gpl2Only;
55 maintainers = with maintainers; [ sumnerevans ];
56 };
57}