1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, token-bucket
6}:
7
8buildPythonPackage rec {
9 pname = "limiter";
10 version = "0.1.2";
11
12 disabled = pythonOlder "3.7";
13
14 src = fetchFromGitHub {
15 owner = "alexdelorenzo";
16 repo = pname;
17 rev = "v${version}";
18 sha256 = "0cdqw08qw3cid1yjknlh4hqfl46xh4madkjrl7sxk2c1pbwils8r";
19 };
20
21 propagatedBuildInputs = [
22 token-bucket
23 ];
24
25 postPatch = ''
26 substituteInPlace requirements.txt \
27 --replace "token-bucket==0.2.0" "token-bucket>=0.2.0"
28 '';
29
30 # Project has no tests
31 doCheck = false;
32
33 pythonImportsCheck = [
34 "limiter"
35 ];
36
37 meta = with lib; {
38 description = "Python rate-limiting, thread-safe and asynchronous decorators and context managers";
39 homepage = "https://github.com/alexdelorenzo/limiter";
40 license = with licenses; [ agpl3Only ];
41 maintainers = with maintainers; [ fab ];
42 };
43}