depot/third_party/nixpkgs/pkgs/development/python-modules/levenshtein/default.nix
Default email bb584b27e9 Project import generated by Copybara.
GitOrigin-RevId: 5181d5945eda382ff6a9ca3e072ed6ea9b547fee
2022-04-15 03:41:22 +02:00

46 lines
922 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, rapidfuzz
}:
buildPythonPackage rec {
pname = "levenshtein";
version = "0.18.1";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "maxbachmann";
repo = "Levenshtein";
rev = "v${version}";
sha256 = "sha256-3p9LM4tv45bqeTsuyngivqfd5uml7uqGB2ICKqPa0qY=";
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "rapidfuzz >= 1.8.2, < 1.9" "rapidfuzz"
'';
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";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ fab ];
};
}