2022-11-12 12:07:30 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sockio";
|
|
|
|
version = "0.15.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tiagocoutinho";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-NSGd7/k1Yr408dipMNBSPRSwQ+wId7VLxgqMM/UmN/Q=";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "--cov-config=.coveragerc --cov sockio" "" \
|
|
|
|
--replace "--cov-report html --cov-report term" "" \
|
|
|
|
--replace "--durations=2 --verbose" ""
|
|
|
|
'';
|
|
|
|
|
2023-08-01 07:01:21 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-12 12:07:30 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"sockio"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_open_timeout"
|
|
|
|
"test_write_readline_error"
|
|
|
|
"test_open_close"
|
|
|
|
"test_callbacks"
|
|
|
|
"test_coroutine_callbacks"
|
|
|
|
"test_error_callback"
|
|
|
|
"test_eof_callback"
|
|
|
|
"test_write_read"
|
|
|
|
"test_write_readline"
|
|
|
|
"test_write_readlines"
|
|
|
|
"test_writelines_readlines"
|
|
|
|
"test_writelines"
|
|
|
|
"test_readline"
|
|
|
|
"test_readuntil"
|
|
|
|
"test_readexactly"
|
|
|
|
"test_readlines"
|
|
|
|
"test_read"
|
|
|
|
"test_readbuffer"
|
|
|
|
"test_parallel_rw"
|
|
|
|
"test_parallel"
|
|
|
|
"test_stream"
|
|
|
|
"test_timeout"
|
|
|
|
"test_line_stream"
|
|
|
|
"test_block_stream"
|
|
|
|
"test_socket_for_url"
|
|
|
|
"test_root_socket_for_url"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# We don't care about Python 2.x
|
|
|
|
"tests/test_py2.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Implementation of the Modbus protocol";
|
|
|
|
homepage = "https://tiagocoutinho.github.io/sockio/";
|
|
|
|
license = with licenses; [ gpl3Plus ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|