1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, pythonOlder 5, cmake 6, cython 7, pytestCheckHook 8, rapidfuzz 9, rapidfuzz-cpp 10, scikit-build 11}: 12 13buildPythonPackage rec { 14 pname = "levenshtein"; 15 version = "0.20.8"; 16 format = "pyproject"; 17 18 disabled = pythonOlder "3.6"; 19 20 src = fetchFromGitHub { 21 owner = "maxbachmann"; 22 repo = "Levenshtein"; 23 rev = "refs/tags/v${version}"; 24 hash = "sha256-McTgQa4c+z+ABlm+tOgVf82meXZ1vWlzYCREnkxIfv0="; 25 }; 26 27 nativeBuildInputs = [ 28 cmake 29 cython 30 scikit-build 31 ]; 32 33 dontUseCmakeConfigure = true; 34 35 buildInputs = [ 36 rapidfuzz-cpp 37 ]; 38 39 propagatedBuildInputs = [ 40 rapidfuzz 41 ]; 42 43 checkInputs = [ 44 pytestCheckHook 45 ]; 46 47 pythonImportsCheck = [ 48 "Levenshtein" 49 ]; 50 51 meta = with lib; { 52 description = "Functions for fast computation of Levenshtein distance and string similarity"; 53 homepage = "https://github.com/maxbachmann/Levenshtein"; 54 changelog = "https://github.com/maxbachmann/Levenshtein/blob/${src.rev}/HISTORY.md"; 55 license = licenses.gpl2Plus; 56 maintainers = with maintainers; [ fab ]; 57 }; 58}