ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / aiolimiter / default.nix
blob9f8f81e2fca8527d9bb0ac5c1ee6823f912813e8
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , fetchpatch
5 , poetry-core
6 , importlib-metadata
7 , pytest-asyncio
8 , pytestCheckHook
9 , pythonOlder
10 , toml
13 buildPythonPackage rec {
14   pname = "aiolimiter";
15   version = "1.0.0";
16   format = "pyproject";
18   disabled = pythonOlder "3.7";
20   src = fetchFromGitHub {
21     owner = "mjpieters";
22     repo = pname;
23     rev = "v${version}";
24     sha256 = "sha256-4wByVZoOLhrXFx9oK19GBmRcjGoJolQ3Gwx9vQV/n8s=";
25   };
27   nativeBuildInputs = [
28     poetry-core
29   ];
31   propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [
32     importlib-metadata
33   ];
35   checkInputs = [
36     pytest-asyncio
37     pytestCheckHook
38     toml
39   ];
41   patches = [
42     # Switch to poetry-core, https://github.com/mjpieters/aiolimiter/pull/77
43     (fetchpatch {
44       name = "switch-to-peotry-core.patch";
45       url = "https://github.com/mjpieters/aiolimiter/commit/84a85eff42621b0daff8fcf6bb485db313faae0b.patch";
46       sha256 = "sha256-xUfJwLvMF2Xt/V1bKBFn/fjn1uyw7bGNo9RpWxtyr50=";
47     })
48   ];
50   postPatch = ''
51     substituteInPlace tox.ini \
52       --replace " --cov=aiolimiter --cov-config=tox.ini --cov-report term-missing" ""
53   '';
55   pythonImportsCheck = [
56     "aiolimiter"
57   ];
59   meta = with lib; {
60     description = "Implementation of a rate limiter for asyncio";
61     homepage = "https://github.com/mjpieters/aiolimiter";
62     license = with licenses; [ mit ];
63     maintainers = with maintainers; [ fab ];
64   };