1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 async-timeout,
6 docopt,
7 pyserial,
8 pyserial-asyncio,
9 setuptools,
10 pytestCheckHook,
11 pythonOlder,
12}:
13
14buildPythonPackage rec {
15 pname = "rflink";
16 version = "0.0.66";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "aequitas";
23 repo = "python-rflink";
24 rev = "refs/tags/${version}";
25 hash = "sha256-n6VLa0xX1qewMS7Kv+kiitezWRbRvDJRNuOmA7IV6u0=";
26 };
27
28 propagatedBuildInputs = [
29 async-timeout
30 docopt
31 pyserial
32 pyserial-asyncio
33 setuptools
34 ];
35
36 nativeCheckInputs = [ pytestCheckHook ];
37
38 postPatch = ''
39 substituteInPlace setup.py \
40 --replace "version=version_from_git()" "version='${version}'"
41 '';
42
43 pythonImportsCheck = [ "rflink.protocol" ];
44
45 meta = with lib; {
46 description = "Library and CLI tools for interacting with RFlink 433MHz transceiver";
47 homepage = "https://github.com/aequitas/python-rflink";
48 changelog = "https://github.com/aequitas/python-rflink/releases/tag/${version}";
49 license = licenses.mit;
50 maintainers = with maintainers; [ dotlambda ];
51 };
52}