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