diff --git a/pkgs/development/python-modules/python-redis-lock/default.nix b/pkgs/development/python-modules/python-redis-lock/default.nix index b89a7534a2ab4..f793482a2c483 100644 --- a/pkgs/development/python-modules/python-redis-lock/default.nix +++ b/pkgs/development/python-modules/python-redis-lock/default.nix @@ -1,19 +1,19 @@ -{ - lib, - stdenv, - buildPythonPackage, - setuptools, - eventlet, - fetchPypi, - fetchpatch, - gevent, - pkgs, - process-tests, - pytestCheckHook, - pythonOlder, - redis, - withDjango ? false, - django-redis, +{ lib +, stdenv +, buildPythonPackage +, setuptools +, eventlet +, fetchPypi +, fetchpatch +, gevent +, pkgs +, process-tests +, pytestCheckHook +, pythonOlder +, redis +, withDjango ? false +, django-redis +, }: buildPythonPackage rec { @@ -30,12 +30,17 @@ buildPythonPackage rec { hash = "sha256-Sr0Lz0kTasrWZye/VIbdJJQHjKVeSe+mk/eUB3MZCRo="; }; + # Fix django tests + prePatch = lib.optionalString withDjango '' + substituteInPlace tests/test_project/settings.py \ + --replace "USE_L10N = True" "" + ''; + patches = [ (fetchpatch { url = "https://github.com/ionelmc/python-redis-lock/pull/119.diff"; hash = "sha256-Fo43+pCtnrEMxMdEEdo0YfJGkBlhhH0GjYNgpZeHF3U="; }) - ./test_signal_expiration_increase_sleep.patch ]; @@ -49,16 +54,13 @@ buildPythonPackage rec { pkgs.redis ]; - disabledTests = - [ - # https://github.com/ionelmc/python-redis-lock/issues/86 - "test_no_overlap2" - ] - ++ lib.optionals stdenv.isDarwin [ - # fail on Darwin because it defaults to multiprocessing `spawn` - "test_reset_signalizes" - "test_reset_all_signalizes" - ]; + preCheck = lib.optionalString withDjango "export DJANGO_SETTINGS_MODULE=test_project.settings"; + + disabledTests = lib.optionals stdenv.isDarwin [ + # fail on Darwin because it defaults to multiprocessing `spawn` + "test_reset_signalizes" + "test_reset_all_signalizes" + ]; pythonImportsCheck = [ "redis_lock" ]; @@ -67,6 +69,6 @@ buildPythonPackage rec { description = "Lock context manager implemented via redis SETNX/BLPOP"; homepage = "https://github.com/ionelmc/python-redis-lock"; license = licenses.bsd2; - maintainers = with maintainers; [ vanschelven ]; + maintainers = with maintainers; [ erictapen ]; }; }