2019-05-07 14:53:23 +02:00
|
|
|
{ lib
|
2019-09-02 04:53:50 +02:00
|
|
|
, stdenv
|
2019-05-07 14:53:23 +02:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pyopenssl
|
|
|
|
, libuv
|
|
|
|
, psutil
|
|
|
|
, isPy27
|
2020-01-23 02:59:31 +01:00
|
|
|
, pythonAtLeast
|
2019-09-02 04:53:50 +02:00
|
|
|
, CoreServices
|
|
|
|
, ApplicationServices
|
2019-05-07 14:53:23 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uvloop";
|
2019-11-11 22:08:07 +01:00
|
|
|
version = "0.14.0";
|
2020-01-23 02:59:31 +01:00
|
|
|
# python 3.8 hangs on tests, assuming it's subtly broken with race condition
|
|
|
|
disabled = isPy27 || pythonAtLeast "3.8";
|
2019-05-07 14:53:23 +02:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-11-11 22:08:07 +01:00
|
|
|
sha256 = "07j678z9gf41j98w72ysrnb5sa41pl5yxd7ib17lcwfxqz0cjfhj";
|
2019-05-07 14:53:23 +02:00
|
|
|
};
|
|
|
|
|
2019-09-13 23:11:56 +02:00
|
|
|
patches = lib.optional stdenv.isDarwin ./darwin_sandbox.patch;
|
|
|
|
|
2019-09-02 04:53:50 +02:00
|
|
|
buildInputs = [
|
|
|
|
libuv
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Removing code linting tests, which we don't care about
|
|
|
|
rm tests/test_sourcecode.py
|
|
|
|
'';
|
2019-05-07 14:53:23 +02:00
|
|
|
|
|
|
|
checkInputs = [ pyopenssl psutil ];
|
|
|
|
|
2019-09-13 23:11:56 +02:00
|
|
|
# Some of the tests use localhost networking.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2019-05-07 14:53:23 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Fast implementation of asyncio event loop on top of libuv";
|
2020-01-22 11:26:22 +01:00
|
|
|
homepage = https://github.com/MagicStack/uvloop;
|
2019-05-07 14:53:23 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|