nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix

83 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, cmake
, cython_3
, ninja
, rapidfuzz-capi
, scikit-build
, setuptools
, jarowinkler
, numpy
, hypothesis
, jarowinkler-cpp
, pandas
, pytestCheckHook
, rapidfuzz-cpp
, taskflow
}:
buildPythonPackage rec {
pname = "rapidfuzz";
version = "2.1.2";
disabled = pythonOlder "3.6";
format = "pyproject";
src = fetchFromGitHub {
owner = "maxbachmann";
repo = "RapidFuzz";
rev = "v${version}";
hash = "sha256-7BP22Fon+7a3ZxTCS838uoLXABYdEexMEH2vZ0/KoRQ=";
};
nativeBuildInputs = [
cmake
cython_3
ninja
rapidfuzz-capi
scikit-build
setuptools
];
dontUseCmakeConfigure = true;
buildInputs = [
jarowinkler-cpp
rapidfuzz-cpp
taskflow
];
preBuild = ''
export RAPIDFUZZ_BUILD_EXTENSION=1
'';
propagatedBuildInputs = [
jarowinkler
numpy
];
checkInputs = [
hypothesis
pandas
pytestCheckHook
];
pythonImportsCheck = [
"rapidfuzz.fuzz"
"rapidfuzz.string_metric"
"rapidfuzz.process"
"rapidfuzz.utils"
];
meta = with lib; {
description = "Rapid fuzzy string matching";
homepage = "https://github.com/maxbachmann/RapidFuzz";
changelog = "https://github.com/maxbachmann/RapidFuzz/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}