1{ lib
2, buildPythonPackage
3, connio
4, fetchFromGitHub
5, pytest-asyncio
6, pytestCheckHook
7, pythonOlder
8, setuptools
9, umodbus
10}:
11
12buildPythonPackage rec {
13 pname = "async-modbus";
14 version = "0.2.0";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "tiagocoutinho";
21 repo = "async_modbus";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-TB+ndUvLZ9G3XXEBpLb4ULHlYZC2CoqGnL2BjMQrhRg=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace '"--cov=async_modbus",' "" \
29 --replace '"--cov-report=html", "--cov-report=term",' "" \
30 --replace '"--durations=2", "--verbose"' ""
31 '';
32
33 nativeBuildInputs = [
34 setuptools
35 ];
36
37 propagatedBuildInputs = [
38 connio
39 umodbus
40 ];
41
42 checkInputs = [
43 pytest-asyncio
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [
48 "async_modbus"
49 ];
50
51 meta = with lib; {
52 description = "Library for Modbus communication";
53 homepage = "https://github.com/tiagocoutinho/async_modbus";
54 license = with licenses; [ gpl3Plus ];
55 maintainers = with maintainers; [ fab ];
56 };
57}