summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorFabian Möller <fabianm88@gmail.com>2019-09-13 23:11:56 +0200
committerFabian Möller <fabianm88@gmail.com>2019-09-13 23:11:56 +0200
commit69ee17f0602f9dee6203e0186a6934d6cebb7022 (patch)
treef2b9d81260f8f28c406e0dbcccb358e23774cb90 /pkgs/development/python-modules
parenta4bea6db8b428309b1e8d33087b778625fac4dfb (diff)
downloadnixpkgs-69ee17f0602f9dee6203e0186a6934d6cebb7022.tar
nixpkgs-69ee17f0602f9dee6203e0186a6934d6cebb7022.tar.gz
nixpkgs-69ee17f0602f9dee6203e0186a6934d6cebb7022.tar.bz2
nixpkgs-69ee17f0602f9dee6203e0186a6934d6cebb7022.tar.lz
nixpkgs-69ee17f0602f9dee6203e0186a6934d6cebb7022.tar.xz
nixpkgs-69ee17f0602f9dee6203e0186a6934d6cebb7022.tar.zst
nixpkgs-69ee17f0602f9dee6203e0186a6934d6cebb7022.zip
uvloop: fix darwin build
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/uvloop/darwin_sandbox.patch28
-rw-r--r--pkgs/development/python-modules/uvloop/default.nix5
2 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/uvloop/darwin_sandbox.patch b/pkgs/development/python-modules/uvloop/darwin_sandbox.patch
new file mode 100644
index 00000000000..bd4e5e48b14
--- /dev/null
+++ b/pkgs/development/python-modules/uvloop/darwin_sandbox.patch
@@ -0,0 +1,28 @@
+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)
diff --git a/pkgs/development/python-modules/uvloop/default.nix b/pkgs/development/python-modules/uvloop/default.nix
index 2093f4d7053..171f6d6ed32 100644
--- a/pkgs/development/python-modules/uvloop/default.nix
+++ b/pkgs/development/python-modules/uvloop/default.nix
@@ -20,6 +20,8 @@ buildPythonPackage rec {
     sha256 = "0blcnrd5vky2k1m1p1skx4516dr1jx76yyb0c6fi82si6mqd0b4l";
   };
 
+  patches = lib.optional stdenv.isDarwin ./darwin_sandbox.patch;
+
   buildInputs = [
     libuv
   ] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
@@ -31,6 +33,9 @@ buildPythonPackage rec {
 
   checkInputs = [ pyopenssl psutil ];
 
+  # Some of the tests use localhost networking.
+  __darwinAllowLocalNetworking = true;
+
   meta = with lib; {
     description = "Fast implementation of asyncio event loop on top of libuv";
     homepage = http://github.com/MagicStack/uvloop;