nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, cmake
6, cython_3
7, rapidfuzz-capi
8, scikit-build
9, jarowinkler
10, numpy
11, hypothesis
12, jarowinkler-cpp
13, pandas
14, pytestCheckHook
15, rapidfuzz-cpp
16, taskflow
17}:
18
19buildPythonPackage rec {
20 pname = "rapidfuzz";
21 version = "2.0.11";
22
23 disabled = pythonOlder "3.6";
24
25 src = fetchFromGitHub {
26 owner = "maxbachmann";
27 repo = "RapidFuzz";
28 rev = "v${version}";
29 hash = "sha256-npmdnUMrmbHgUgqMxKBytgtL1weWw6BjVNmBkYSKNMw=";
30 };
31
32 nativeBuildInputs = [
33 cmake
34 cython_3
35 rapidfuzz-capi
36 scikit-build
37 ];
38
39 dontUseCmakeConfigure = true;
40
41 buildInputs = [
42 jarowinkler-cpp
43 rapidfuzz-cpp
44 taskflow
45 ];
46
47 propagatedBuildInputs = [
48 jarowinkler
49 numpy
50 ];
51
52 checkInputs = [
53 hypothesis
54 pandas
55 pytestCheckHook
56 ];
57
58 preCheck = ''
59 # import from $out
60 rm -r rapidfuzz
61 '';
62
63 pythonImportsCheck = [
64 "rapidfuzz.fuzz"
65 "rapidfuzz.string_metric"
66 "rapidfuzz.process"
67 "rapidfuzz.utils"
68 ];
69
70 meta = with lib; {
71 description = "Rapid fuzzy string matching";
72 homepage = "https://github.com/maxbachmann/RapidFuzz";
73 license = licenses.mit;
74 maintainers = with maintainers; [ dotlambda ];
75 };
76}