depot/third_party/nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix
Default email 13da32182d Project import generated by Copybara.
GitOrigin-RevId: a7855f2235a1876f97473a76151fec2afa02b287
2022-08-21 15:32:41 +02:00

82 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.5.0";
disabled = pythonOlder "3.6";
format = "pyproject";
src = fetchFromGitHub {
owner = "maxbachmann";
repo = "RapidFuzz";
rev = "refs/tags/v${version}";
hash = "sha256-Cdzf6qQZQzH+tRyLEYvi7c01L5i+6WmgHozLhFQNsiQ=";
};
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 ];
};
}