about summary refs log tree commit diff
path: root/pkgs/development/python-modules/asyncua/default.nix
blob: f474a8f6a52690f556497fd12e123069f5081e20 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, aiosqlite
, aiofiles
, pytz
, python-dateutil
, sortedcontainers
, cryptography
, typing-extensions
, importlib-metadata
, pytestCheckHook
, pytest-asyncio
, pytest-mock
, asynctest
, pythonOlder
}:

buildPythonPackage rec {
  pname = "asyncua";
  version = "1.0.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "FreeOpcUa";
    repo = "opcua-asyncio";
    rev = "v${version}";
    hash = "sha256-wBtI3ZlsvOkNvl/q0X9cm2hNRUBW1oB/kZOo8lqo4dQ=";
  };

  propagatedBuildInputs = [
    aiosqlite
    aiofiles
    pytz
    python-dateutil
    sortedcontainers
    cryptography
    typing-extensions
  ] ++ lib.optionals (pythonOlder "3.8") [
    importlib-metadata
  ];

  pythonImportsCheck = [
    "asyncua"
  ];

  checkInputs = [
    pytestCheckHook
    pytest-asyncio
    pytest-mock
    asynctest
  ];

  disabledTests = [
    "test_cli_tools_which_require_sigint" # Hard coded path only works from root of src
  ];

  meta = with lib; {
    description = "OPC UA / IEC 62541 Client and Server for Python";
    homepage = "https://github.com/FreeOpcUa/opcua-asyncio";
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ harvidsen ];
  };
}