python3Packages.uvloop: 0.14.0 -> 0.15.0

Reenable all tests, drop darwin sandbox patch, cleanup.

This unbreaks uvloop on python3.9.
master
Martin Weinelt 2021-02-10 15:41:17 +01:00
parent cc0da25d94
commit fe0892d030
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
2 changed files with 23 additions and 52 deletions

View File

@ -1,28 +0,0 @@
diff --git a/tests/test_pipes.py b/tests/test_pipes.py
index d883abf..2e74d7a 100644
--- a/tests/test_pipes.py
+++ b/tests/test_pipes.py
@@ -2,6 +2,7 @@ import asyncio
import io
import os
import socket
+import unittest
from uvloop import _testbase as tb
@@ -96,6 +97,7 @@ class _BasePipeTest:
# extra info is available
self.assertIsNotNone(proto.transport.get_extra_info('pipe'))
+ @unittest.skip("darwin sandbox")
def test_read_pty_output(self):
proto = MyReadPipeProto(loop=self.loop)
@@ -198,6 +200,7 @@ class _BasePipeTest:
self.loop.run_until_complete(proto.done)
self.assertEqual('CLOSED', proto.state)
+ @unittest.skip("darwin sandbox")
def test_write_pty(self):
master, slave = os.openpty()
os.set_blocking(master, False)

View File

@ -1,69 +1,69 @@
{ lib
, stdenv
, buildPythonPackage
, pythonOlder
, fetchPypi
, pyopenssl
, libuv
, psutil
, isPy27
, pythonAtLeast
, CoreServices
, ApplicationServices
# Check Inputs
, aiohttp
, psutil
, pyopenssl
, pytestCheckHook
# , pytest-asyncio
}:
buildPythonPackage rec {
pname = "uvloop";
version = "0.14.0";
disabled = isPy27;
version = "0.15.0";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "07j678z9gf41j98w72ysrnb5sa41pl5yxd7ib17lcwfxqz0cjfhj";
sha256 = "0rfhr84km8k5gj0036b2pznwmc8macx56vkxc3aksvns95dksl0s";
};
patches = lib.optional stdenv.isDarwin ./darwin_sandbox.patch;
buildInputs = [
libuv
] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
pythonImportsCheck = [
"uvloop"
"uvloop.loop"
] ++ lib.optionals stdenv.isDarwin [
CoreServices
ApplicationServices
];
dontUseSetuptoolsCheck = true;
checkInputs = [ pytestCheckHook pyopenssl psutil ];
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"
];
disabledTests = [
"test_sock_cancel_add_reader_race" # asyncio version of test is supposed to be skipped but skip doesn't happen. uvloop version runs fine
] ++ lib.optionals (pythonAtLeast "3.8") [ "test_write_to_closed_transport" ]; # https://github.com/MagicStack/uvloop/issues/355
# 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
'' + lib.optionalString stdenv.isDarwin ''
# Some tests fail on Darwin
rm tests/test_[stu]*.py
'';
postCheck = ''
popd
'';
pythonImportsCheck = [
"uvloop"
"uvloop.loop"
];
# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;
@ -72,6 +72,5 @@ buildPythonPackage rec {
homepage = "https://github.com/MagicStack/uvloop";
license = licenses.mit;
maintainers = with maintainers; [ costrouc ];
broken = pythonAtLeast "3.9"; # see: https://github.com/MagicStack/uvloop/issues/365
};
}