Skip to content

Commit

Permalink
python3Packages.python-redis-locks: fix tests for withDjango = true
Browse files Browse the repository at this point in the history
Also remove a skipped test that just seems to work

Remove maintainer, as they asked for it here:
NixOS#212270 (comment)
  • Loading branch information
erictapen committed Jul 4, 2024
1 parent 2d813aa commit 081d9e7
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions pkgs/development/python-modules/python-redis-lock/default.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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
];

Expand All @@ -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" ];

Expand All @@ -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 ];
};
}

0 comments on commit 081d9e7

Please sign in to comment.