2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
|
|
|
, cython
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "editdistance";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.6.0";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "roy-ht";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "17xkndwdyf14nfxk25z1qnhkzm0yxw65fpj78c01haq241zfzjr5";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cythonize --inplace editdistance/bycython.pyx
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "editdistance" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python implementation of the edit distance (Levenshtein distance)";
|
|
|
|
homepage = "https://github.com/roy-ht/editdistance";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|