2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
buildPythonPackage,
|
|
|
|
setuptools,
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# propagated
|
|
|
|
django,
|
|
|
|
hiredis,
|
|
|
|
lz4,
|
|
|
|
msgpack,
|
|
|
|
redis,
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# testing
|
|
|
|
pkgs,
|
|
|
|
pytest-django,
|
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildPythonPackage rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "django-redis";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "5.4.0";
|
|
|
|
pyproject = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jazzband";
|
|
|
|
repo = "django-redis";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-m7z3c7My24vrSSnyfDQ/LlWhy7pV4U0L8LATMvkfczc=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i '/-cov/d' setup.cfg
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
django
|
|
|
|
lz4
|
|
|
|
msgpack
|
|
|
|
redis
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
hiredis = [ redis ] ++ redis.optional-dependencies.hiredis;
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "django_redis" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
DJANGO_SETTINGS_MODULE = "tests.settings.sqlite";
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
${pkgs.redis}/bin/redis-server &
|
2022-01-26 04:04:25 +00:00
|
|
|
REDIS_PID=$!
|
|
|
|
'';
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
kill $REDIS_PID
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytest-django
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# ModuleNotFoundError: No module named 'test_cache_options'
|
|
|
|
"test_custom_key_function"
|
|
|
|
# ModuleNotFoundError: No module named 'test_client'
|
2023-11-16 04:20:00 +00:00
|
|
|
"test_delete_pattern_calls_delete_for_given_keys"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_delete_pattern_calls_get_client_given_no_client"
|
|
|
|
"test_delete_pattern_calls_make_pattern"
|
2023-10-09 19:29:22 +00:00
|
|
|
"test_delete_pattern_calls_pipeline_delete_and_execute"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_delete_pattern_calls_scan_iter"
|
2023-11-16 04:20:00 +00:00
|
|
|
"test_delete_pattern_calls_scan_iter_with_count_if_itersize_given"
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Full featured redis cache backend for Django";
|
|
|
|
homepage = "https://github.com/jazzband/django-redis";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/jazzband/django-redis/releases/tag/${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|