1{ lib
2, aiofiles
3, aiosqlite
4, buildPythonPackage
5, cryptography
6, fetchFromGitHub
7, pytest-asyncio
8, pytest-mock
9, pytestCheckHook
10, python-dateutil
11, pythonOlder
12, pytz
13, sortedcontainers
14, typing-extensions
15}:
16
17buildPythonPackage rec {
18 pname = "asyncua";
19 version = "1.0.2";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "FreeOpcUa";
26 repo = "opcua-asyncio";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-DnBxR4nD3dBBhiElDuRgljHaoBPiakdjY/VFn3VsKEQ=";
29 fetchSubmodules = true;
30 };
31
32 postPatch = ''
33 # https://github.com/FreeOpcUa/opcua-asyncio/issues/1263
34 substituteInPlace setup.py \
35 --replace ", 'asynctest'" ""
36
37 # Workaround hardcoded paths in test
38 # "test_cli_tools_which_require_sigint"
39 substituteInPlace tests/test_tools.py \
40 --replace "tools/" "$out/bin/"
41 '';
42
43 propagatedBuildInputs = [
44 aiosqlite
45 aiofiles
46 pytz
47 python-dateutil
48 sortedcontainers
49 cryptography
50 typing-extensions
51 ];
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 pytest-asyncio
56 pytest-mock
57 ];
58
59 pythonImportsCheck = [
60 "asyncua"
61 ];
62
63 meta = with lib; {
64 description = "OPC UA / IEC 62541 Client and Server for Python";
65 homepage = "https://github.com/FreeOpcUa/opcua-asyncio";
66 changelog = "https://github.com/FreeOpcUa/opcua-asyncio/releases/tag/v${version}";
67 license = licenses.lgpl3Plus;
68 maintainers = with maintainers; [ harvidsen ];
69 };
70}