Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / token-bucket / default.nix
blob0805ee9dea39e8cd9decfe6a62b0e9fb1595e782
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
5 , fetchpatch
6 , pytestCheckHook
7 , pythonOlder
8 , setuptools
9 }:
11 buildPythonPackage rec {
12   pname = "token-bucket";
13   version = "0.3.0";
14   pyproject = true;
16   disabled = pythonOlder "3.7";
18   src = fetchFromGitHub {
19     owner = "falconry";
20     repo = pname;
21     rev = "refs/tags/${version}";
22     hash = "sha256-dazqJRpC8FUHOhgKFzDnIl5CT2L74J2o2Hsm0IQf4Cg=";
23   };
25   patches = [
26     # Replace imp with importlib, https://github.com/falconry/token-bucket/pull/24
27     (fetchpatch {
28       name = "remove-imp.patch";
29       url = "https://github.com/falconry/token-bucket/commit/10a3c9f4de00f4933349f66b4c72b6c96db6e766.patch";
30       hash = "sha256-Hk5+i3xzeA3F1kXRaRarWT9mff2lT2WNmTfTZvYzGYI=";
31     })
32   ];
34   postPatch = ''
35     substituteInPlace setup.py \
36       --replace "'pytest-runner'" ""
37   '';
39   nativeBuildInputs = [
40     setuptools
41   ];
43   nativeCheckInputs = [
44     pytestCheckHook
45   ];
47   doCheck = !stdenv.isDarwin;
49   meta = with lib; {
50     description = "Token Bucket Implementation for Python Web Apps";
51     homepage = "https://github.com/falconry/token-bucket";
52     changelog = "https://github.com/falconry/token-bucket/releases/tag/${version}";
53     license = licenses.asl20;
54     maintainers = with maintainers; [ hexa ];
55   };