mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-26 10:14:48 +00:00
68 lines
1.5 KiB
Nix
68 lines
1.5 KiB
Nix
{
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
hatchling,
|
|
lib,
|
|
pymodbus,
|
|
pyprojectVersionPatchHook,
|
|
pytest-asyncio,
|
|
pytestCheckHook,
|
|
tmodbus,
|
|
}:
|
|
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "modbus-connection";
|
|
version = "3.9.0";
|
|
pyproject = true;
|
|
__structuredAttrs = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "home-assistant-libs";
|
|
repo = "modbus-connection";
|
|
tag = finalAttrs.version;
|
|
hash = "sha256-WmPjIAxC9e6tYxPJSQpvdhUNj2tbYim5e1RP5MIiL9M=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
pyprojectVersionPatchHook
|
|
];
|
|
|
|
build-system = [
|
|
hatchling
|
|
];
|
|
|
|
optional-dependencies = {
|
|
pymodbus = [
|
|
pymodbus
|
|
]
|
|
++ pymodbus.optional-dependencies.serial;
|
|
tmodbus = [
|
|
tmodbus
|
|
]
|
|
++ tmodbus.optional-dependencies.async-serial;
|
|
};
|
|
|
|
nativeCheckInputs = [
|
|
pytest-asyncio
|
|
pytestCheckHook
|
|
]
|
|
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
|
|
|
|
disabledTests = [
|
|
# tries to git clone https://github.com/sunspec/models
|
|
"test_official_model_catalogue_generates_and_imports"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"modbus_connection"
|
|
];
|
|
|
|
meta = {
|
|
description = "Small, backend-neutral Modbus connection abstraction";
|
|
homepage = "https://github.com/home-assistant-libs/modbus-connection";
|
|
changelog = "https://github.com/home-assistant-libs/modbus-connection/releases/tag/${finalAttrs.src.tag}";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ hexa ];
|
|
};
|
|
})
|