about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix b/nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix
new file mode 100644
index 000000000000..8743e5014e04
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/rapidfuzz/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildPythonPackage
+, pythonOlder
+, fetchFromGitHub
+, pytestCheckHook
+, hypothesis
+, pandas
+}:
+
+buildPythonPackage rec {
+  pname = "rapidfuzz";
+  version = "1.4.1";
+
+  disabled = pythonOlder "3.5";
+
+  src = fetchFromGitHub {
+    owner = "maxbachmann";
+    repo = "RapidFuzz";
+    rev = "v${version}";
+    fetchSubmodules = true;
+    sha256 = "sha256-uZdD25ATJgRrDAHYSQNp7NvEmW7p3LD9vNmxAbf5Mwk=";
+  };
+
+  checkInputs = [
+    pytestCheckHook
+    hypothesis
+    pandas
+  ];
+
+  disabledTests = [
+    "test_levenshtein_block" # hypothesis data generation too slow
+  ];
+
+  pythonImportsCheck = [
+    "rapidfuzz.fuzz"
+    "rapidfuzz.string_metric"
+    "rapidfuzz.process"
+    "rapidfuzz.utils"
+  ];
+
+  meta = with lib; {
+    description = "Rapid fuzzy string matching";
+    homepage = "https://github.com/maxbachmann/rapidfuzz";
+    license = licenses.mit;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}