Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / asyncua / default.nix
blob3666d8716d960d1dd59f0bf6a84dead3918a19ca
1 { lib
2 , stdenv
3 , aiofiles
4 , aiosqlite
5 , buildPythonPackage
6 , cryptography
7 , fetchFromGitHub
8 , pyopenssl
9 , pytest-asyncio_0_21
10 , pytest-mock
11 , pytestCheckHook
12 , python-dateutil
13 , pythonOlder
14 , pytz
15 , setuptools
16 , sortedcontainers
17 , typing-extensions
20 buildPythonPackage rec {
21   pname = "asyncua";
22   version = "1.1.0";
23   pyproject = true;
25   disabled = pythonOlder "3.8";
27   src = fetchFromGitHub {
28     owner = "FreeOpcUa";
29     repo = "opcua-asyncio";
30     rev = "refs/tags/v${version}";
31     hash = "sha256-tHlo5oNsb8E6r0vmSi0eVbk4RCMg0xe97LITzW9FQWA=";
32     fetchSubmodules = true;
33   };
35   postPatch = ''
36     # https://github.com/FreeOpcUa/opcua-asyncio/issues/1263
37     substituteInPlace setup.py \
38       --replace ", 'asynctest'" ""
40     # Workaround hardcoded paths in test
41     # "test_cli_tools_which_require_sigint"
42     substituteInPlace tests/test_tools.py \
43       --replace "tools/" "$out/bin/"
44   '';
46   nativeBuildInputs = [
47     setuptools
48   ];
50   propagatedBuildInputs = [
51     aiofiles
52     aiosqlite
53     cryptography
54     pyopenssl
55     python-dateutil
56     pytz
57     sortedcontainers
58     typing-extensions
59   ];
61   nativeCheckInputs = [
62     pytestCheckHook
63     pytest-asyncio_0_21
64     pytest-mock
65   ];
67   pythonImportsCheck = [
68     "asyncua"
69   ];
71   disabledTests = lib.optionals stdenv.isDarwin [
72     # Failed: DID NOT RAISE <class 'asyncio.exceptions.TimeoutError'>
73     "test_publish"
74     # OSError: [Errno 48] error while attempting to bind on address ('127.0.0.1',...
75     "test_anonymous_rejection"
76     "test_certificate_handling_success"
77     "test_encrypted_private_key_handling_success"
78     "test_encrypted_private_key_handling_success_with_cert_props"
79     "test_encrypted_private_key_handling_failure"
80   ];
82   meta = with lib; {
83     description = "OPC UA / IEC 62541 Client and Server for Python";
84     homepage = "https://github.com/FreeOpcUa/opcua-asyncio";
85     changelog = "https://github.com/FreeOpcUa/opcua-asyncio/releases/tag/v${version}";
86     license = licenses.lgpl3Plus;
87     maintainers = with maintainers; [ harvidsen ];
88   };