diff options
Diffstat (limited to 'pkgs/development/python-modules/walrus/default.nix')
-rw-r--r-- | pkgs/development/python-modules/walrus/default.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/walrus/default.nix b/pkgs/development/python-modules/walrus/default.nix new file mode 100644 index 00000000000..73376590bda --- /dev/null +++ b/pkgs/development/python-modules/walrus/default.nix @@ -0,0 +1,52 @@ +{ lib +, pkgs +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, redis +, unittestCheckHook +}: + +buildPythonPackage rec { + pname = "walrus"; + version = "0.9.3"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "coleifer"; + repo = "walrus"; + rev = "refs/tags/${version}"; + hash = "sha256-jinYMGSBAY8HTg92qU/iU5vGIrrDr5SeQG0XjsBVfcc="; + }; + + propagatedBuildInputs = [ + redis + ]; + + nativeCheckInputs = [ + unittestCheckHook + ]; + + preCheck = '' + ${pkgs.redis}/bin/redis-server & + REDIS_PID=$! + ''; + + postCheck = '' + kill $REDIS_PID + ''; + + pythonImportsCheck = [ + "walrus" + ]; + + meta = with lib; { + description = "Lightweight Python utilities for working with Redis"; + homepage = "https://github.com/coleifer/walrus"; + changelog = "https://github.com/coleifer/walrus/blob/${version}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ mbalatsko ]; + }; +} |