about summary refs log tree commit diff
path: root/pkgs/development/python-modules/limiter/default.nix
blob: 21217f34673f7f8dc3c337e21b54d06980c3590f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, token-bucket
}:

buildPythonPackage rec {
  pname = "limiter";
  version = "0.1.2";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "alexdelorenzo";
    repo = pname;
    rev = "v${version}";
    sha256 = "0cdqw08qw3cid1yjknlh4hqfl46xh4madkjrl7sxk2c1pbwils8r";
  };

  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 ];
  };
}