1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 pyopenssl,
12
13 # test
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "aioopenssl";
19 version = "0.6.0";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "horazont";
24 repo = "aioopenssl";
25 tag = "v${version}";
26 hash = "sha256-7Q+4/DlP+kUnC3YNk7woJaxLEEiuVmolUOajepM003Q=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [ pyopenssl ];
32
33 pythonImportsCheck = [ "aioopenssl" ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 # Tests that fail in when built in the Darwin sandbox.
38 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
39 # address already in use
40 "test_renegotiate"
41 # permission error (tries to bind to port not allowed by sandbox)
42 "test_abort"
43 "test_close_during_handshake"
44 "test_connect_send_recv_close"
45 "test_data_is_sent_after_handshake"
46 "test_local_addr"
47 "test_no_data_is_received_after_handshake"
48 "test_no_data_is_received_if_handshake_crashes"
49 "test_no_data_is_sent_if_handshake_crashes"
50 "test_post_handshake_exception_is_propagated"
51 "test_recv_large_data"
52 "test_renegotiation"
53 "test_send_and_receive_data"
54 "test_send_large_data"
55 "test_send_recv_large_data"
56 "test_starttls"
57 ];
58
59 __darwinAlowLocalNetworking = true;
60
61 meta = {
62 description = "TLS-capable transport using OpenSSL for asyncio";
63 homepage = "https://github.com/horazont/aioopenssl";
64 license = lib.licenses.asl20;
65 maintainers = with lib.maintainers; [ dotlambda ];
66 };
67}