2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
cbor-diag,
|
|
|
|
cbor2,
|
|
|
|
cryptography,
|
|
|
|
dtlssocket,
|
|
|
|
fetchFromGitHub,
|
|
|
|
filelock,
|
|
|
|
ge25519,
|
|
|
|
pygments,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
termcolor,
|
|
|
|
websockets,
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aiocoap";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.4.10";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chrysn";
|
2024-06-05 15:53:02 +00:00
|
|
|
repo = "aiocoap";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-sKDkbv8OyPewfQpunFxezP0wjy3EAQxsQ0UfUm0REPM=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2021-07-03 03:11:41 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
2024-04-21 15:54:59 +00:00
|
|
|
oscore = [
|
|
|
|
cbor2
|
|
|
|
cryptography
|
|
|
|
filelock
|
|
|
|
ge25519
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
tinydtls = [ dtlssocket ];
|
|
|
|
ws = [ websockets ];
|
2024-04-21 15:54:59 +00:00
|
|
|
prettyprint = [
|
|
|
|
termcolor
|
|
|
|
cbor2
|
|
|
|
pygments
|
|
|
|
cbor-diag
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Don't test the plugins
|
|
|
|
"tests/test_tls.py"
|
|
|
|
"tests/test_reverseproxy.py"
|
|
|
|
"tests/test_oscore_plugtest.py"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# Communication is not properly mocked
|
|
|
|
"test_uri_parser"
|
2024-07-27 06:49:29 +00:00
|
|
|
# Doctest
|
|
|
|
"test_001"
|
2024-06-05 15:53:02 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# https://github.com/chrysn/aiocoap/issues/339
|
|
|
|
"TestServerTCP::test_big_resource"
|
|
|
|
"TestServerTCP::test_empty_accept"
|
|
|
|
"TestServerTCP::test_error_resources"
|
|
|
|
"TestServerTCP::test_fast_resource"
|
|
|
|
"TestServerTCP::test_js_accept"
|
|
|
|
"TestServerTCP::test_manualbig_resource"
|
|
|
|
"TestServerTCP::test_nonexisting_resource"
|
|
|
|
"TestServerTCP::test_replacing_resource"
|
|
|
|
"TestServerTCP::test_root_resource"
|
|
|
|
"TestServerTCP::test_slow_resource"
|
|
|
|
"TestServerTCP::test_slowbig_resource"
|
|
|
|
"TestServerTCP::test_spurious_resource"
|
|
|
|
"TestServerTCP::test_unacceptable_accept"
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "aiocoap" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python CoAP library";
|
|
|
|
homepage = "https://aiocoap.readthedocs.io/";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/chrysn/aiocoap/blob/${version}/NEWS";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|