1{
2 lib,
3 stdenv,
4 aiofiles,
5 aiosqlite,
6 buildPythonPackage,
7 cryptography,
8 fetchFromGitHub,
9 pyopenssl,
10 pytest-asyncio_0_21,
11 pytest-mock,
12 pytestCheckHook,
13 python-dateutil,
14 pythonOlder,
15 pytz,
16 setuptools,
17 sortedcontainers,
18 typing-extensions,
19}:
20
21buildPythonPackage rec {
22 pname = "asyncua";
23 version = "1.1.5";
24 pyproject = true;
25
26 disabled = pythonOlder "3.8";
27
28 src = fetchFromGitHub {
29 owner = "FreeOpcUa";
30 repo = "opcua-asyncio";
31 rev = "refs/tags/v${version}";
32 hash = "sha256-XXjzYDOEBdA4uk0VCzscHrPCY2Lgin0JBAVDdxmSOio=";
33 fetchSubmodules = true;
34 };
35
36 postPatch = ''
37 # Workaround hardcoded paths in test
38 # "test_cli_tools_which_require_sigint"
39 substituteInPlace tests/test_tools.py \
40 --replace-fail "tools/" "$out/bin/"
41 '';
42
43 build-system = [ setuptools ];
44
45 dependencies = [
46 aiofiles
47 aiosqlite
48 cryptography
49 pyopenssl
50 python-dateutil
51 pytz
52 sortedcontainers
53 typing-extensions
54 ];
55
56 nativeCheckInputs = [
57 pytestCheckHook
58 pytest-asyncio_0_21
59 pytest-mock
60 ];
61
62 pythonImportsCheck = [ "asyncua" ];
63
64 disabledTests = [
65 # Failed: DID NOT RAISE <class 'asyncio.exceptions.TimeoutError'>
66 "test_publish"
67 ] ++ lib.optionals stdenv.isDarwin [
68 # OSError: [Errno 48] error while attempting to bind on address ('127.0.0.1',...
69 "test_anonymous_rejection"
70 "test_certificate_handling_success"
71 "test_encrypted_private_key_handling_success"
72 "test_encrypted_private_key_handling_success_with_cert_props"
73 "test_encrypted_private_key_handling_failure"
74 ];
75
76 meta = with lib; {
77 description = "OPC UA / IEC 62541 Client and Server for Python";
78 homepage = "https://github.com/FreeOpcUa/opcua-asyncio";
79 changelog = "https://github.com/FreeOpcUa/opcua-asyncio/releases/tag/v${version}";
80 license = licenses.lgpl3Plus;
81 maintainers = with maintainers; [ harvidsen ];
82 };
83}