python312Packages.dash-renderer: remove (#369714)
[NixPkgs.git] / pkgs / development / python-modules / token-bucket / default.nix
blob8faffa98b28ff9cd2f04cc1a081102483fef523b
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   fetchpatch,
7   pytestCheckHook,
8   pythonOlder,
9   setuptools,
12 buildPythonPackage rec {
13   pname = "token-bucket";
14   version = "0.3.0";
15   pyproject = true;
17   disabled = pythonOlder "3.7";
19   src = fetchFromGitHub {
20     owner = "falconry";
21     repo = pname;
22     tag = version;
23     hash = "sha256-dazqJRpC8FUHOhgKFzDnIl5CT2L74J2o2Hsm0IQf4Cg=";
24   };
26   patches = [
27     # Replace imp with importlib, https://github.com/falconry/token-bucket/pull/24
28     (fetchpatch {
29       name = "remove-imp.patch";
30       url = "https://github.com/falconry/token-bucket/commit/10a3c9f4de00f4933349f66b4c72b6c96db6e766.patch";
31       hash = "sha256-Hk5+i3xzeA3F1kXRaRarWT9mff2lT2WNmTfTZvYzGYI=";
32     })
33   ];
35   postPatch = ''
36     substituteInPlace setup.py \
37       --replace "'pytest-runner'" ""
38   '';
40   nativeBuildInputs = [ setuptools ];
42   nativeCheckInputs = [ pytestCheckHook ];
44   doCheck = !stdenv.hostPlatform.isDarwin;
46   meta = with lib; {
47     description = "Token Bucket Implementation for Python Web Apps";
48     homepage = "https://github.com/falconry/token-bucket";
49     changelog = "https://github.com/falconry/token-bucket/releases/tag/${version}";
50     license = licenses.asl20;
51     maintainers = with maintainers; [ hexa ];
52   };