1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, pythonOlder
5, pytest
6, stdenv
7}:
8
9buildPythonPackage rec {
10 pname = "websockets";
11 version = "8.1";
12
13 src = fetchFromGitHub {
14 owner = "aaugustin";
15 repo = pname;
16 rev = version;
17 sha256 = "05jbqcbjg50ydwl0fijhdlqcq7fl6v99kjva66kmmzzza7vwa872";
18 };
19
20 disabled = pythonOlder "3.3";
21
22 # Tests fail on Darwin with `OSError: AF_UNIX path too long`
23 doCheck = !stdenv.isDarwin;
24
25 # Disable all tests that need to terminate within a predetermined amount of
26 # time. This is nondeterministic.
27 patchPhase = ''
28 sed -i 's/with self.assertCompletesWithin.*:/if True:/' \
29 tests/test_protocol.py
30 '';
31
32 meta = with lib; {
33 description = "WebSocket implementation in Python 3";
34 homepage = "https://github.com/aaugustin/websockets";
35 license = licenses.bsd3;
36 };
37}