nixpkgs/pkgs/development/python-modules/uvloop/default.nix

77 lines
1.4 KiB
Nix
Raw Normal View History

2019-05-07 13:53:23 +01:00
{ lib
, stdenv
2019-05-07 13:53:23 +01:00
, buildPythonPackage
, pythonOlder
2019-05-07 13:53:23 +01:00
, fetchPypi
, libuv
, CoreServices
, ApplicationServices
# Check Inputs
, aiohttp
, psutil
, pyopenssl
, pytestCheckHook
2019-05-07 13:53:23 +01:00
}:
buildPythonPackage rec {
pname = "uvloop";
version = "0.15.0";
disabled = pythonOlder "3.7";
2019-05-07 13:53:23 +01:00
src = fetchPypi {
inherit pname version;
sha256 = "0rfhr84km8k5gj0036b2pznwmc8macx56vkxc3aksvns95dksl0s";
2019-05-07 13:53:23 +01:00
};
buildInputs = [
libuv
] ++ lib.optionals stdenv.isDarwin [
CoreServices
ApplicationServices
];
dontUseSetuptoolsCheck = true;
checkInputs = [
aiohttp
pytestCheckHook
pyopenssl
psutil
];
pytestFlagsArray = [
# from pytest.ini, these are NECESSARY to prevent failures
"--capture=no"
"--assert=plain"
"--strict"
"--tb=native"
# ignore code linting tests
"--ignore=tests/test_sourcecode.py"
];
2019-05-07 13:53:23 +01:00
# force using installed/compiled uvloop vs source by moving tests to temp dir
preCheck = ''
export TEST_DIR=$(mktemp -d)
cp -r tests $TEST_DIR
pushd $TEST_DIR
'';
postCheck = ''
popd
'';
2019-05-07 13:53:23 +01:00
pythonImportsCheck = [
"uvloop"
"uvloop.loop"
];
2019-09-13 22:11:56 +01:00
# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;
2019-05-07 13:53:23 +01:00
meta = with lib; {
description = "Fast implementation of asyncio event loop on top of libuv";
homepage = "https://github.com/MagicStack/uvloop";
2019-05-07 13:53:23 +01:00
license = licenses.mit;
maintainers = with maintainers; [ costrouc ];
2019-05-07 13:53:23 +01:00
};
}