2021-04-05 15:23:46 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
2022-04-27 09:35:20 +00:00
|
|
|
, cmake
|
|
|
|
, cython_3
|
2022-06-16 17:23:12 +00:00
|
|
|
, ninja
|
2022-04-27 09:35:20 +00:00
|
|
|
, rapidfuzz-capi
|
|
|
|
, scikit-build
|
2022-06-26 10:26:21 +00:00
|
|
|
, setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
, jarowinkler
|
|
|
|
, numpy
|
2021-04-05 15:23:46 +00:00
|
|
|
, hypothesis
|
2022-04-27 09:35:20 +00:00
|
|
|
, jarowinkler-cpp
|
2021-04-05 15:23:46 +00:00
|
|
|
, pandas
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, rapidfuzz-cpp
|
|
|
|
, taskflow
|
2021-04-05 15:23:46 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rapidfuzz";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "2.5.0";
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "maxbachmann";
|
|
|
|
repo = "RapidFuzz";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-08-21 13:32:41 +00:00
|
|
|
hash = "sha256-Cdzf6qQZQzH+tRyLEYvi7c01L5i+6WmgHozLhFQNsiQ=";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
cython_3
|
2022-06-16 17:23:12 +00:00
|
|
|
ninja
|
2022-04-27 09:35:20 +00:00
|
|
|
rapidfuzz-capi
|
|
|
|
scikit-build
|
2022-06-26 10:26:21 +00:00
|
|
|
setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
jarowinkler-cpp
|
|
|
|
rapidfuzz-cpp
|
|
|
|
taskflow
|
|
|
|
];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
preBuild = ''
|
|
|
|
export RAPIDFUZZ_BUILD_EXTENSION=1
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
jarowinkler
|
2021-09-18 10:52:07 +00:00
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
checkInputs = [
|
|
|
|
hypothesis
|
|
|
|
pandas
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
2021-04-05 15:23:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"rapidfuzz.fuzz"
|
|
|
|
"rapidfuzz.string_metric"
|
|
|
|
"rapidfuzz.process"
|
|
|
|
"rapidfuzz.utils"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Rapid fuzzy string matching";
|
2021-10-04 12:37:57 +00:00
|
|
|
homepage = "https://github.com/maxbachmann/RapidFuzz";
|
2022-06-26 10:26:21 +00:00
|
|
|
changelog = "https://github.com/maxbachmann/RapidFuzz/blob/${src.rev}/CHANGELOG.md";
|
2021-04-05 15:23:46 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|