Files
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

62 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
connio,
fetchFromGitHub,
fetchpatch,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
setuptools,
umodbus,
}:
buildPythonPackage rec {
pname = "async-modbus";
version = "0.2.3";
pyproject = true;
src = fetchFromGitHub {
owner = "tiagocoutinho";
repo = "async_modbus";
tag = "v${version}";
hash = "sha256-d4TTs3TtD/9eFdzXBaY+QeAMeRWTvsWeaxONeG0AXJU=";
};
patches = [
(fetchpatch {
# Fix tests; https://github.com/tiagocoutinho/async_modbus/pull/13
url = "https://github.com/tiagocoutinho/async_modbus/commit/d81d8ffe94870f0f505e0c8a0694768c98053ecc.patch";
hash = "sha256-mG3XO2nAFYitatkswU7er29BJc/A0IL1rL2Zu4daZ7k=";
})
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace '"--durations=2", "--verbose"' ""
'';
build-system = [ setuptools ];
dependencies = [
connio
umodbus
];
nativeCheckInputs = [
pytest-asyncio
pytest-cov-stub
pytestCheckHook
];
pythonImportsCheck = [ "async_modbus" ];
meta = {
description = "Library for Modbus communication";
homepage = "https://github.com/tiagocoutinho/async_modbus";
changelog = "https://github.com/tiagocoutinho/async_modbus/releases/tag/${src.tag}";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ fab ];
};
}