Files
nixpkgs/pkgs/development/python-modules/django-ratelimit/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

57 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";
tag = "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 = {
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 = lib.licenses.asl20;
maintainers = with lib.maintainers; [ derdennisop ];
};
}