nixpkgs/pkgs/development/python-modules/sockio/default.nix
Guillaume Girol 33afbf39f6 treewide: switch to nativeCheckInputs
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
2023-01-21 12:00:00 +00:00

81 lines
1.7 KiB
Nix

{ 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" ""
'';
nativeCheckInputs = [
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 ];
};
}