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