2021-11-21 18:01:05 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2022-04-15 01:59:46 +01:00
|
|
|
, cmake
|
|
|
|
, cython
|
2021-11-21 18:01:05 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, rapidfuzz
|
2022-07-05 16:47:27 +01:00
|
|
|
, rapidfuzz-cpp
|
2022-04-15 01:59:46 +01:00
|
|
|
, scikit-build
|
2021-11-21 18:01:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "levenshtein";
|
2022-07-20 12:58:45 +01:00
|
|
|
version = "0.19.3";
|
2022-04-15 01:59:46 +01:00
|
|
|
format = "pyproject";
|
2021-11-21 18:01:05 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "maxbachmann";
|
|
|
|
repo = "Levenshtein";
|
2022-07-10 06:03:00 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-07-20 12:58:45 +01:00
|
|
|
hash = "sha256-4Oc1n/ZgLdq57ZeyZHzTQOjar9Ligeb4yqKeT0s5dHY=";
|
2021-11-21 18:01:05 +00:00
|
|
|
};
|
|
|
|
|
2022-04-15 01:59:46 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
cython
|
|
|
|
scikit-build
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
2021-12-12 17:57:05 +00:00
|
|
|
|
2022-07-05 16:47:27 +01:00
|
|
|
buildInputs = [
|
|
|
|
rapidfuzz-cpp
|
|
|
|
];
|
|
|
|
|
2021-11-21 18:01:05 +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 ];
|
|
|
|
};
|
|
|
|
}
|