diff options
-rw-r--r-- | pkgs/development/python-modules/cachier/default.nix | 87 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
2 files changed, 89 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 0000000000000..2a1fe461d51ca --- /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; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f629c30fa769e..06b377a746c19 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1691,6 +1691,8 @@ self: super: with self; { cacheyou = callPackage ../development/python-modules/cacheyou { }; + cachier = callPackage ../development/python-modules/cachier { }; + cachy = callPackage ../development/python-modules/cachy { }; cadquery = callPackage ../development/python-modules/cadquery { |