2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2022-04-27 09:35:20 +00:00
|
|
|
, cmake
|
|
|
|
, cython
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, rapidfuzz
|
2022-07-14 12:49:19 +00:00
|
|
|
, rapidfuzz-cpp
|
2022-04-27 09:35:20 +00:00
|
|
|
, scikit-build
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "levenshtein";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "0.19.2";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "pyproject";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "maxbachmann";
|
|
|
|
repo = "Levenshtein";
|
2022-07-14 12:49:19 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-tedoSeCwMWHwPlZ8qvzIMjVj5W9qJVoLAsT35hQBc/g=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
cython
|
|
|
|
scikit-build
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
buildInputs = [
|
|
|
|
rapidfuzz-cpp
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
rapidfuzz
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"Levenshtein"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Functions for fast computation of Levenshtein distance and string similarity";
|
|
|
|
homepage = "https://github.com/maxbachmann/Levenshtein";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|