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