nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, cmake
6, cython
7, pytestCheckHook
8, rapidfuzz
9, scikit-build
10}:
11
12buildPythonPackage rec {
13 pname = "levenshtein";
14 version = "0.18.1";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "maxbachmann";
21 repo = "Levenshtein";
22 rev = "v${version}";
23 # https://github.com/maxbachmann/Levenshtein/issues/22
24 fetchSubmodules = true;
25 sha256 = "sha256-WREYdD5MFOpCzH4BSceRpzQZdpi3Xxxn0DpMvDsNlGo=";
26 };
27
28 nativeBuildInputs = [
29 cmake
30 cython
31 scikit-build
32 ];
33
34 dontUseCmakeConfigure = true;
35
36 propagatedBuildInputs = [
37 rapidfuzz
38 ];
39
40 checkInputs = [
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [
45 "Levenshtein"
46 ];
47
48 meta = with lib; {
49 description = "Functions for fast computation of Levenshtein distance and string similarity";
50 homepage = "https://github.com/maxbachmann/Levenshtein";
51 license = licenses.gpl2Plus;
52 maintainers = with maintainers; [ fab ];
53 };
54}