depot/third_party/nixpkgs/pkgs/development/python-modules/django-ratelimit/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

56 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, django
, django-redis
, fetchFromGitHub
, pymemcache
, pythonOlder
, setuptools
}:
buildPythonPackage rec {
pname = "django-ratelimit";
version = "4.1.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "jsocol";
repo = "django-ratelimit";
rev = "refs/tags/v${version}";
hash = "sha256-ZMtZSKOIIRSqH6eyC7bBeua7YLKyWW6NOXN/MDv9fy4=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
django
django-redis
pymemcache
];
pythonImportsCheck = [
"django_ratelimit"
];
checkPhase = ''
runHook preCheck
export DJANGO_SETTINGS_MODULE=test_settings
python -m django test django_ratelimit
runHook postCheck
'';
meta = with lib; {
description = "Cache-based rate-limiting for Django";
homepage = "https://github.com/jsocol/django-ratelimit";
changelog = "https://github.com/jsocol/django-ratelimit/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ derdennisop ];
};
}