depot/third_party/nixpkgs/pkgs/development/python-modules/django-cacheops/default.nix
Default email c7f94ff3ce Project import generated by Copybara.
GitOrigin-RevId: b85ed9dcbf187b909ef7964774f8847d554fab3b
2023-08-22 22:05:09 +02:00

80 lines
1.4 KiB
Nix

{ stdenv
, lib
, buildPythonPackage
, fetchPypi
, pythonRelaxDepsHook
, django
, funcy
, redis
, six
, pytestCheckHook
, pytest-django
, mock
, dill
, jinja2
, before-after
, pythonOlder
, nettools
, pkgs
}:
buildPythonPackage rec {
pname = "django-cacheops";
version = "7.0.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-Ed3qh90DlWiXikCD2JyJ37hm6lWnpI+2haaPwZiotlA=";
};
nativeBuildInputs = [
pythonRelaxDepsHook
];
pythonRelaxDeps = [ "funcy" ];
propagatedBuildInputs = [
django
funcy
redis
six
];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
pytestCheckHook
pytest-django
mock
dill
jinja2
before-after
nettools
pkgs.redis
];
preCheck = ''
redis-server &
REDIS_PID=$!
while ! redis-cli --scan ; do
echo waiting for redis to be ready
sleep 1
done
'';
postCheck = ''
kill $REDIS_PID
'';
DJANGO_SETTINGS_MODULE = "tests.settings";
meta = with lib; {
description = "A slick ORM cache with automatic granular event-driven invalidation for Django";
homepage = "https://github.com/Suor/django-cacheops";
changelog = "https://github.com/Suor/django-cacheops/blob/${version}/CHANGELOG";
license = licenses.bsd3;
maintainers = with maintainers; [ onny ];
};
}