diff --git a/pkgs/development/python-modules/async_stagger/default.nix b/pkgs/development/python-modules/async_stagger/default.nix new file mode 100644 index 00000000000..034a8329b12 --- /dev/null +++ b/pkgs/development/python-modules/async_stagger/default.nix @@ -0,0 +1,44 @@ +{ lib +, buildPythonPackage +, fetchPypi +, fetchpatch +, pythonOlder +, pytestCheckHook +, pytest-asyncio +, pytest-mock +}: + +buildPythonPackage rec { + pname = "async_stagger"; + version = "0.3.0"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "007l54fbk2dfzv3vmqz98m1i37mzxkkva5r4fiwq2pg8nb61fy0w"; + }; + + patches = [ + (fetchpatch { + # Fix test failures on Python 3.8 + # https://github.com/twisteroidambassador/async_stagger/issues/4 + url = "https://github.com/twisteroidambassador/async_stagger/commit/736ab20ff9c172628d911f1e6f72420399ec9631.patch"; + sha256 = "1ygqd9n56sj83lvgmv6nrx3m0sp3646s5k7z697qx43xslixj731"; + }) + ]; + + checkInputs = [ + pytestCheckHook + pytest-asyncio + pytest-mock + ]; + + pythonImportsCheck = [ "async_stagger" ]; + + meta = with lib; { + description = "Happy Eyeballs connection algorithm and underlying scheduling logic in asyncio"; + homepage = "https://github.com/twisteroidambassador/async_stagger"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 86da8934719..1c8fee71e3e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -432,6 +432,8 @@ in { asyncssh = callPackage ../development/python-modules/asyncssh { }; + async_stagger = callPackage ../development/python-modules/async_stagger { }; + asynctest = callPackage ../development/python-modules/asynctest { }; async-timeout = callPackage ../development/python-modules/async_timeout { };