1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 pytestCheckHook,
7
8 pythonOlder,
9
10 setuptools,
11 cython,
12
13 symspellpy,
14 numpy,
15 editdistpy,
16}:
17
18buildPythonPackage rec {
19 pname = "editdistpy";
20 version = "0.1.5";
21 pyproject = true;
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = "mammothb";
27 repo = "editdistpy";
28 tag = "v${version}";
29 hash = "sha256-kTaJkx1fdd2Rl4uhzxdZAFP/ArsM0qTPweJ1jlUcjxQ=";
30 };
31
32 build-system = [
33 setuptools
34 cython
35 ];
36
37 # error: infinite recursion encountered
38 doCheck = false;
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 symspellpy
43 numpy
44 ];
45
46 preCheck = ''
47 rm -r editdistpy
48 '';
49
50 passthru.tests = {
51 check = editdistpy.overridePythonAttrs (_: {
52 doCheck = true;
53 });
54 };
55
56 pythonImportsCheck = [ "editdistpy" ];
57
58 meta = with lib; {
59 description = "Fast Levenshtein and Damerau optimal string alignment algorithms";
60 homepage = "https://github.com/mammothb/editdistpy";
61 changelog = "https://github.com/mammothb/editdistpy/releases/tag/v${version}";
62 license = licenses.mit;
63 maintainers = with maintainers; [ vizid ];
64 };
65}