depot/third_party/nixpkgs/pkgs/development/python-modules/levenshtein/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

63 lines
1.2 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, cmake
, cython
, pytestCheckHook
, rapidfuzz
, rapidfuzz-cpp
, scikit-build
}:
buildPythonPackage rec {
pname = "levenshtein";
version = "0.20.8";
format = "pyproject";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "maxbachmann";
repo = "Levenshtein";
rev = "refs/tags/v${version}";
hash = "sha256-McTgQa4c+z+ABlm+tOgVf82meXZ1vWlzYCREnkxIfv0=";
};
nativeBuildInputs = [
cmake
cython
scikit-build
];
dontUseCmakeConfigure = true;
buildInputs = [
rapidfuzz-cpp
];
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [
"-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098
];
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";
changelog = "https://github.com/maxbachmann/Levenshtein/blob/${src.rev}/HISTORY.md";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ fab ];
};
}