depot/third_party/nixpkgs/pkgs/development/python-modules/levenshtein/default.nix
Default email 5ca88bfbb9 Project import generated by Copybara.
GitOrigin-RevId: 9f918d616c5321ad374ae6cb5ea89c9e04bf3e58
2024-07-31 10:19:44 +00:00

53 lines
1.1 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
cmake,
cython,
fetchFromGitHub,
pytestCheckHook,
pythonOlder,
rapidfuzz,
rapidfuzz-cpp,
scikit-build,
}:
buildPythonPackage rec {
pname = "levenshtein";
version = "0.25.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "maxbachmann";
repo = "Levenshtein";
rev = "refs/tags/v${version}";
hash = "sha256-ye2XQL/ZQPlA4dy3tlr03WyGhfl7SaOXMt10cWHnW5o=";
fetchSubmodules = true; # # for vendored `rapidfuzz-cpp`
};
nativeBuildInputs = [
cmake
cython
scikit-build
];
dontUseCmakeConfigure = true;
buildInputs = [ rapidfuzz-cpp ];
dependencies = [ rapidfuzz ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "Levenshtein" ];
meta = with lib; {
description = "Functions for fast computation of Levenshtein distance and string similarity";
homepage = "https://github.com/maxbachmann/Levenshtein";
changelog = "https://github.com/maxbachmann/Levenshtein/blob/${src.rev}/HISTORY.md";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ fab ];
};
}