2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
2023-08-04 22:07:22 +00:00
|
|
|
, stdenv
|
2022-12-02 08:20:57 +00:00
|
|
|
, aiofiles
|
2023-03-30 22:05:00 +00:00
|
|
|
, aiosqlite
|
|
|
|
, buildPythonPackage
|
2022-12-02 08:20:57 +00:00
|
|
|
, cryptography
|
2023-03-30 22:05:00 +00:00
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, pyopenssl
|
2022-12-02 08:20:57 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-mock
|
2023-03-30 22:05:00 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, python-dateutil
|
2022-12-02 08:20:57 +00:00
|
|
|
, pythonOlder
|
2023-03-30 22:05:00 +00:00
|
|
|
, pytz
|
|
|
|
, sortedcontainers
|
|
|
|
, typing-extensions
|
2022-12-02 08:20:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "asyncua";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.0.5";
|
2022-12-02 08:20:57 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FreeOpcUa";
|
|
|
|
repo = "opcua-asyncio";
|
2023-03-30 22:05:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-eDrnDDiijkr5377BVWVAc5QEQCCDBoFynuT4MncCx9g=";
|
2023-04-12 12:48:02 +00:00
|
|
|
fetchSubmodules = true;
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/FreeOpcUa/opcua-asyncio/issues/1263
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace ", 'asynctest'" ""
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
# Workaround hardcoded paths in test
|
|
|
|
# "test_cli_tools_which_require_sigint"
|
|
|
|
substituteInPlace tests/test_tools.py \
|
|
|
|
--replace "tools/" "$out/bin/"
|
2023-03-30 22:05:00 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiofiles
|
2023-10-09 19:29:22 +00:00
|
|
|
aiosqlite
|
|
|
|
cryptography
|
|
|
|
pyopenssl
|
2022-12-02 08:20:57 +00:00
|
|
|
python-dateutil
|
2023-10-09 19:29:22 +00:00
|
|
|
pytz
|
2022-12-02 08:20:57 +00:00
|
|
|
sortedcontainers
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-02 08:20:57 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-mock
|
2023-03-30 22:05:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"asyncua"
|
2022-12-02 08:20:57 +00:00
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# Failed: DID NOT RAISE <class 'asyncio.exceptions.TimeoutError'>
|
|
|
|
"test_publish"
|
|
|
|
# OSError: [Errno 48] error while attempting to bind on address ('127.0.0.1',...
|
|
|
|
"test_anonymous_rejection"
|
|
|
|
"test_certificate_handling_success"
|
|
|
|
"test_encrypted_private_key_handling_success"
|
|
|
|
"test_encrypted_private_key_handling_success_with_cert_props"
|
|
|
|
"test_encrypted_private_key_handling_failure"
|
|
|
|
];
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "OPC UA / IEC 62541 Client and Server for Python";
|
|
|
|
homepage = "https://github.com/FreeOpcUa/opcua-asyncio";
|
2023-03-30 22:05:00 +00:00
|
|
|
changelog = "https://github.com/FreeOpcUa/opcua-asyncio/releases/tag/v${version}";
|
2022-12-02 08:20:57 +00:00
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
maintainers = with maintainers; [ harvidsen ];
|
|
|
|
};
|
|
|
|
}
|