1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cmake,
6 cython,
7 ninja,
8 scikit-build-core,
9 rapidfuzz-cpp,
10 rapidfuzz,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "levenshtein";
16 version = "0.27.1";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "maxbachmann";
21 repo = "Levenshtein";
22 tag = "v${version}";
23 hash = "sha256-EFEyP7eqB4sUQ2ksD67kCr0BEShTiKWbk1PxXOUOGc4=";
24 };
25
26 build-system = [
27 cmake
28 cython
29 ninja
30 scikit-build-core
31 ];
32
33 dontUseCmakeConfigure = true;
34
35 buildInputs = [ rapidfuzz-cpp ];
36
37 dependencies = [ rapidfuzz ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 pythonImportsCheck = [ "Levenshtein" ];
42
43 meta = {
44 description = "Functions for fast computation of Levenshtein distance and string similarity";
45 homepage = "https://github.com/maxbachmann/Levenshtein";
46 changelog = "https://github.com/maxbachmann/Levenshtein/blob/v${version}/HISTORY.md";
47 license = lib.licenses.gpl2Plus;
48 maintainers = with lib.maintainers; [ fab ];
49 };
50}