1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 fetchpatch,
6 isPy3k,
7 pytestCheckHook,
8 sphinx,
9 stdenv,
10}:
11
12buildPythonPackage rec {
13 pname = "curio";
14 version = "1.6";
15 format = "setuptools";
16 disabled = !isPy3k;
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-VipYbbICFrp9K+gmPeuesHnlYEj5uJBtEdX0WqgcUkc=";
21 };
22
23 patches = [
24 (fetchpatch {
25 # Add support for Python 3.12
26 # https://github.com/dabeaz/curio/pull/363
27 url = "https://github.com/dabeaz/curio/commit/a5590bb04de3f1f201fd1fd0ce9cfe5825db80ac.patch";
28 hash = "sha256-dwatxLOPAWLQSyNqJvkx6Cbl327tX9OpZXM5aaDX58I=";
29 })
30 ];
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 sphinx
35 ];
36
37 __darwinAllowLocalNetworking = true;
38
39 disabledTests =
40 [
41 "test_aside_basic" # times out
42 "test_write_timeout" # flaky, does not always time out
43 "test_aside_cancel" # fails because modifies PYTHONPATH and cant find pytest
44 "test_ssl_outgoing" # touches network
45 "test_unix_echo" # socket bind error on hydra when built with other packages
46 "test_unix_ssl_server" # socket bind error on hydra when built with other packages
47 ]
48 ++ lib.optionals stdenv.isDarwin [
49 # connects to python.org:1, expects an OsError, hangs in the darwin sandbox
50 "test_create_bad_connection"
51 ];
52
53 pythonImportsCheck = [ "curio" ];
54
55 meta = with lib; {
56 description = "Library for performing concurrent I/O with coroutines in Python";
57 homepage = "https://github.com/dabeaz/curio";
58 changelog = "https://github.com/dabeaz/curio/raw/${version}/CHANGES";
59 license = licenses.bsd3;
60 maintainers = [ maintainers.pbsds ];
61 };
62}