summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2023-09-09 16:30:53 +0200
committerPeder Bergebakken Sundt <pbsds@hotmail.com>2023-09-11 21:47:47 +0200
commit0996a248c55eefb4431f38dc54815eb6dc40fed9 (patch)
tree6ab1f87573a6033bcec1c034e198ba982e2f7824 /pkgs/development
parentd13e942758a6a1571dee59b32fe3d60651626342 (diff)
downloadnixpkgs-0996a248c55eefb4431f38dc54815eb6dc40fed9.tar
nixpkgs-0996a248c55eefb4431f38dc54815eb6dc40fed9.tar.gz
nixpkgs-0996a248c55eefb4431f38dc54815eb6dc40fed9.tar.bz2
nixpkgs-0996a248c55eefb4431f38dc54815eb6dc40fed9.tar.lz
nixpkgs-0996a248c55eefb4431f38dc54815eb6dc40fed9.tar.xz
nixpkgs-0996a248c55eefb4431f38dc54815eb6dc40fed9.tar.zst
nixpkgs-0996a248c55eefb4431f38dc54815eb6dc40fed9.zip
python3Packages.cachier: init at 2.2.1
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/cachier/default.nix87
1 files changed, 87 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/cachier/default.nix b/pkgs/development/python-modules/cachier/default.nix
new file mode 100644
index 00000000000..2a1fe461d51
--- /dev/null
+++ b/pkgs/development/python-modules/cachier/default.nix
@@ -0,0 +1,87 @@
+{ lib
+, buildPythonPackage
+, pythonOlder
+, fetchPypi
+, pythonRelaxDepsHook
+, setuptools
+, watchdog
+, portalocker
+, pathtools
+, pytestCheckHook
+, pymongo
+, dnspython
+, pymongo-inmemory
+, pandas
+}:
+
+buildPythonPackage rec {
+  pname = "cachier";
+  version = "2.2.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-nm98LT87Z7yErKvIqMp93OEX9TDojqqtItgryHgSQJQ=";
+  };
+
+  pythonRemoveDeps = [ "setuptools" ];
+
+  nativeBuildInputs = [
+    pythonRelaxDepsHook
+    setuptools
+  ];
+
+  propagatedBuildInputs = [
+    watchdog
+    portalocker
+    pathtools
+  ];
+
+  preCheck = ''
+    substituteInPlace pytest.ini \
+      --replace  \
+        "--cov" \
+        "#--cov"
+  '';
+
+  nativeCheckInputs = [
+    pytestCheckHook
+    pymongo
+    dnspython
+    pymongo-inmemory
+    pandas
+  ];
+
+  disabledTests = [
+    # touches network
+    "test_mongetter_default_param"
+    "test_stale_after_applies_dynamically"
+    "test_next_time_applies_dynamically"
+    "test_wait_for_calc_"
+    "test_precache_value"
+    "test_ignore_self_in_methods"
+    "test_mongo_index_creation"
+    "test_mongo_core"
+
+    # don't test formatting
+    "test_flake8"
+  ];
+
+  preBuild = ''
+    export HOME="$(mktemp -d)"
+  '';
+
+  pythonImportsCheck = [
+    "cachier"
+    "cachier.scripts"
+  ];
+
+  meta = {
+    homepage = "https://github.com/python-cachier/cachier";
+    description = "Persistent, stale-free, local and cross-machine caching for functions";
+    maintainers = with lib.maintainers; [ pbsds ];
+    license = lib.licenses.mit;
+  };
+}