about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/snitun/default.nix
blob: 10df697818267998133f5ddd7e1df5dd2cf5870a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{ lib
, stdenv
, setuptools
, async-timeout
, attrs
, buildPythonPackage
, cryptography
, fetchFromGitHub
, pytest-aiohttp
, pytestCheckHook
, pythonAtLeast
, pythonOlder
}:

buildPythonPackage rec {
  pname = "snitun";
  version = "0.36.2";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "NabuCasa";
    repo = "snitun";
    rev = "refs/tags/${version}";
    hash = "sha256-ViNsmTq1iLxNujA71b9JZB5AZ79ZbiqdTyDeBGd4gUA=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    async-timeout
    attrs
    cryptography
  ];

  nativeCheckInputs = [
    pytest-aiohttp
    pytestCheckHook
  ];

  disabledTests = [
    # AssertionError: Expected 'fileno' to not have been called. Called 1 times.
    "test_client_stop_no_wait"
  ] ++ lib.optionals stdenv.isDarwin [
    "test_multiplexer_data_channel_abort_full" # https://github.com/NabuCasa/snitun/issues/61
    # port binding conflicts
    "test_snitun_single_runner_timeout"
    "test_snitun_single_runner_throttling"
    # ConnectionResetError: [Errno 54] Connection reset by peer
    "test_peer_listener_timeout"
  ] ++ lib.optionals (pythonAtLeast "3.12") [
    # blocking
    "test_flow_client_peer"
    "test_close_client_peer"
    "test_init_connector"
    "test_flow_connector"
    "test_close_connector_remote"
    "test_init_connector_whitelist"
    "test_init_multiplexer_server"
    "test_init_multiplexer_client"
    "test_init_multiplexer_server_throttling"
    "test_init_multiplexer_client_throttling"
    "test_multiplexer_ping"
    "test_multiplexer_ping_error"
    "test_multiplexer_init_channel_full"
    "test_multiplexer_close_channel_full"
    "test_init_dual_peer_with_multiplexer"
  ];

  pythonImportsCheck = [ "snitun" ];

  meta = with lib; {
    changelog = "https://github.com/NabuCasa/snitun/releases/tag/${version}";
    homepage = "https://github.com/nabucasa/snitun";
    description = "SNI proxy with TCP multiplexer";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ Scriptkiddi ];
    platforms = platforms.linux;
  };
}