nixpkgs-suyu/pkgs/development/python-modules/limiter/default.nix
2022-01-11 08:20:22 -08:00

44 lines
921 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, token-bucket
}:
buildPythonPackage rec {
pname = "limiter";
version = "0.2.0";
format = "setuptools";
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
owner = "alexdelorenzo";
repo = pname;
rev = "v${version}";
hash = "sha256-h3XiCR/8rcCBwdhO6ExrrUE9piba5mssad3+t41scSk=";
};
propagatedBuildInputs = [
token-bucket
];
postPatch = ''
substituteInPlace requirements.txt \
--replace "token-bucket==0.2.0" "token-bucket>=0.2.0"
'';
# Project has no tests
doCheck = false;
pythonImportsCheck = [
"limiter"
];
meta = with lib; {
description = "Python rate-limiting, thread-safe and asynchronous decorators and context managers";
homepage = "https://github.com/alexdelorenzo/limiter";
license = with licenses; [ agpl3Only ];
maintainers = with maintainers; [ fab ];
};
}