1{ lib 2, pkgs 3, buildPythonPackage 4, fetchFromGitHub 5, pythonOlder 6, redis 7, unittestCheckHook 8}: 9 10buildPythonPackage rec { 11 pname = "walrus"; 12 version = "0.9.3"; 13 format = "setuptools"; 14 15 disabled = pythonOlder "3.7"; 16 17 src = fetchFromGitHub { 18 owner = "coleifer"; 19 repo = "walrus"; 20 rev = "refs/tags/${version}"; 21 hash = "sha256-jinYMGSBAY8HTg92qU/iU5vGIrrDr5SeQG0XjsBVfcc="; 22 }; 23 24 propagatedBuildInputs = [ 25 redis 26 ]; 27 28 nativeCheckInputs = [ 29 unittestCheckHook 30 ]; 31 32 preCheck = '' 33 ${pkgs.redis}/bin/redis-server & 34 REDIS_PID=$! 35 ''; 36 37 postCheck = '' 38 kill $REDIS_PID 39 ''; 40 41 pythonImportsCheck = [ 42 "walrus" 43 ]; 44 45 meta = with lib; { 46 description = "Lightweight Python utilities for working with Redis"; 47 homepage = "https://github.com/coleifer/walrus"; 48 changelog = "https://github.com/coleifer/walrus/blob/${version}/CHANGELOG.md"; 49 license = licenses.mit; 50 maintainers = with maintainers; [ mbalatsko ]; 51 }; 52}