1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, pytestCheckHook
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "token-bucket";
11 version = "0.3.0";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchFromGitHub {
17 owner = "falconry";
18 repo = pname;
19 rev = "refs/tags/${version}";
20 hash = "sha256-dazqJRpC8FUHOhgKFzDnIl5CT2L74J2o2Hsm0IQf4Cg=";
21 };
22
23 postPatch = ''
24 substituteInPlace setup.py \
25 --replace "'pytest-runner'" ""
26 '';
27
28 nativeCheckInputs = [
29 pytestCheckHook
30 ];
31
32 doCheck = !stdenv.isDarwin;
33
34 meta = with lib; {
35 description = "Token Bucket Implementation for Python Web Apps";
36 homepage = "https://github.com/falconry/token-bucket";
37 changelog = "https://github.com/falconry/token-bucket/releases/tag/${version}";
38 license = licenses.asl20;
39 maintainers = with maintainers; [ hexa ];
40 };
41}