Files
nixpkgs/pkgs/development/python-modules/pymodbus/default.nix
T
Martin Weinelt 3d12611232 python312Packages.typer: include standard optional
Typer specifies the standard optional-dependencies package list, but then
due to internal tooling includes it by default in Require-Dist.

https://github.com/tiangolo/typer/blob/0.12.3/pyproject.toml#L71-L72

This is in line with changes that happened in typer 0.12.1

https://github.com/tiangolo/typer/releases/tag/0.12.1
2024-07-18 18:54:10 +02:00

98 lines
2.0 KiB
Nix

{
lib,
aiohttp,
buildPythonPackage,
click,
fetchFromGitHub,
prompt-toolkit,
pygments,
pyserial,
pytest-asyncio,
pytest-xdist,
pytestCheckHook,
pythonOlder,
redis,
setuptools,
sqlalchemy,
twisted,
typer,
}:
buildPythonPackage rec {
pname = "pymodbus";
version = "3.6.9";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "pymodbus-dev";
repo = "pymodbus";
rev = "refs/tags/v${version}";
hash = "sha256-ScqxDO0hif8p3C6+vvm7FgSEQjCXBwUPOc7Y/3OfkoI=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "--cov-report html " ""
'';
build-system = [ setuptools ];
passthru.optional-dependencies = {
repl = [
aiohttp
typer
prompt-toolkit
pygments
click
];
serial = [ pyserial ];
};
nativeCheckInputs = [
pytest-asyncio
pytest-xdist
pytestCheckHook
redis
sqlalchemy
twisted
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
preCheck = ''
pushd test
'';
postCheck = ''
popd
'';
pythonImportsCheck = [ "pymodbus" ];
disabledTests =
[
# Tests often hang
"test_connected"
]
++ lib.optionals (lib.versionAtLeast aiohttp.version "3.9.0") [
"test_split_serial_packet"
"test_serial_poll"
"test_simulator"
];
meta = with lib; {
description = "Python implementation of the Modbus protocol";
longDescription = ''
Pymodbus is a full Modbus protocol implementation using twisted,
torndo or asyncio for its asynchronous communications core. It can
also be used without any third party dependencies if a more
lightweight project is needed.
'';
homepage = "https://github.com/pymodbus-dev/pymodbus";
changelog = "https://github.com/pymodbus-dev/pymodbus/releases/tag/v${version}";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ fab ];
mainProgram = "pymodbus.simulator";
};
}