1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, cython
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "editdistance";
11 version = "0.6.1";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchFromGitHub {
17 owner = "roy-ht";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-c0TdH1nJAKrepatCSCTLaKsDv9NKruMQadCjclKGxBw=";
21 };
22
23 nativeBuildInputs = [
24 cython
25 ];
26
27 preBuild = ''
28 cythonize --inplace editdistance/bycython.pyx
29 '';
30
31 checkInputs = [
32 pytestCheckHook
33 ];
34
35 pythonImportsCheck = [
36 "editdistance"
37 ];
38
39 meta = with lib; {
40 description = "Python implementation of the edit distance (Levenshtein distance)";
41 homepage = "https://github.com/roy-ht/editdistance";
42 license = with licenses; [ mit ];
43 maintainers = with maintainers; [ fab ];
44 };
45}