about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMoraxyc <i@qaq.li>2024-05-27 01:25:22 +0800
committerMoraxyc <i@qaq.li>2024-06-09 09:12:18 +0800
commit9b255814ca0d0877a2c101562d0a9481a1e56942 (patch)
tree58eacaaf97ee7dc409d6d239cc3595640768321e
parent3bcedce9f4de37570242faf16e1e143583407eab (diff)
python312Packages.cashews: init at 7.1.0
-rw-r--r--pkgs/development/python-modules/cashews/default.nix70
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/cashews/default.nix b/pkgs/development/python-modules/cashews/default.nix
new file mode 100644
index 0000000000000..3d75bc80c4758
--- /dev/null
+++ b/pkgs/development/python-modules/cashews/default.nix
@@ -0,0 +1,70 @@
+{
+  bitarray,
+  buildPythonPackage,
+  dill,
+  diskcache,
+  fetchFromGitHub,
+  hiredis,
+  hypothesis,
+  lib,
+  pytest,
+  pytest-asyncio,
+  pytest-cov,
+  pytest-rerunfailures,
+  pytestCheckHook,
+  redis,
+  setuptools,
+  xxhash,
+}:
+
+buildPythonPackage rec {
+  pname = "cashews";
+  version = "7.1.0";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "Krukov";
+    repo = "cashews";
+    rev = "refs/tags/${version}";
+    hash = "sha256-VzIW6/xhKk+ZWd29BYQp6sjpBst8IVz8t/hCLc2LFT4=";
+  };
+
+  build-system = [ setuptools ];
+
+  passthru.optional-dependencies = {
+    dill = [ dill ];
+    diskcache = [ diskcache ];
+    redis = [ redis ];
+    speedup = [
+      bitarray
+      hiredis
+      xxhash
+    ];
+  };
+
+  nativeCheckInputs = [
+    hypothesis
+    pytest
+    pytest-asyncio
+    pytest-cov
+    pytest-rerunfailures
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    # these tests require too many dependencies
+    "redis"
+    "diskcache"
+    "integration"
+  ];
+
+  pythonImportsCheck = [ "cashews" ];
+
+  meta = {
+    description = "Cache tools with async power";
+    homepage = "https://github.com/Krukov/cashews/";
+    changelog = "https://github.com/Krukov/cashews/releases/tag/${version}";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ moraxyc ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 9b5175c1417eb..2b32eb9a1a5cc 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1945,6 +1945,8 @@ self: super: with self; {
 
   cashaddress = callPackage ../development/python-modules/cashaddress { };
 
+  cashews = callPackage ../development/python-modules/cashews {  };
+
   cassandra-driver = callPackage ../development/python-modules/cassandra-driver { };
 
   castepxbin = callPackage ../development/python-modules/castepxbin { };