depot/third_party/nixpkgs/pkgs/development/python-modules/editdistance/default.nix
Default email eeb71630af Project import generated by Copybara.
GitOrigin-RevId: 636051e353461f073ac55d5d42c1ed062a345046
2022-11-02 23:02:43 +01:00

45 lines
846 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, cython
, pythonOlder
}:
buildPythonPackage rec {
pname = "editdistance";
version = "0.6.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "roy-ht";
repo = pname;
rev = "v${version}";
hash = "sha256-c0TdH1nJAKrepatCSCTLaKsDv9NKruMQadCjclKGxBw=";
};
nativeBuildInputs = [
cython
];
preBuild = ''
cythonize --inplace editdistance/bycython.pyx
'';
checkInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"editdistance"
];
meta = with lib; {
description = "Python implementation of the edit distance (Levenshtein distance)";
homepage = "https://github.com/roy-ht/editdistance";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}