summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/sockio/default.nix
blob: e565233c1ad62c92993817c0a57540d76de6ef54 (plain)
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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytest-asyncio,
  pytest-cov-stub,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "sockio";
  version = "0.15.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "tiagocoutinho";
    repo = "sockio";
    tag = "v${version}";
    hash = "sha256-NSGd7/k1Yr408dipMNBSPRSwQ+wId7VLxgqMM/UmN/Q=";
  };

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "--durations=2 --verbose" ""
  '';

  __darwinAllowLocalNetworking = true;

  nativeCheckInputs = [
    pytest-asyncio
    pytest-cov-stub
    pytestCheckHook
  ];

  pythonImportsCheck = [ "sockio" ];

  disabledTests = [
    # Tests require network access
    "test_open_timeout"
    "test_write_readline_error"
    "test_open_close"
    "test_callbacks"
    "test_coroutine_callbacks"
    "test_error_callback"
    "test_eof_callback"
    "test_write_read"
    "test_write_readline"
    "test_write_readlines"
    "test_writelines_readlines"
    "test_writelines"
    "test_readline"
    "test_readuntil"
    "test_readexactly"
    "test_readlines"
    "test_read"
    "test_readbuffer"
    "test_parallel_rw"
    "test_parallel"
    "test_stream"
    "test_timeout"
    "test_line_stream"
    "test_block_stream"
    "test_socket_for_url"
    "test_root_socket_for_url"
  ];

  disabledTestPaths = [
    # We don't care about Python 2.x
    "tests/test_py2.py"
  ];

  meta = {
    description = "Implementation of the Modbus protocol";
    homepage = "https://tiagocoutinho.github.io/sockio/";
    license = with lib.licenses; [ gpl3Plus ];
    maintainers = with lib.maintainers; [ fab ];
  };
}