1{ ansicolors
2, attrs
3, autobahn
4, buildPythonPackage
5, fetchFromGitHub
6, jinja2
7, lib
8, mock
9, pexpect
10, psutil
11, pyserial
12, pytestCheckHook
13, pytest-dependency
14, pytest-mock
15, pyudev
16, pyusb
17, pyyaml
18, requests
19, setuptools-scm
20, xmodem
21}:
22
23buildPythonPackage rec {
24 pname = "labgrid";
25 version = "0.4.0";
26
27 src = fetchFromGitHub {
28 owner = "labgrid-project";
29 repo = "labgrid";
30 rev = "v${version}";
31 sha256 = "17j013dw66h4jm1hl92g892sx9r9c48pnl7d58p1y0l4jfca8gmn";
32 };
33
34 patches = [
35 # Pyserial within Nixpkgs already includes the necessary fix, remove the
36 # pyserial version check from labgrid.
37 ./0001-serialdriver-remove-pyserial-version-check.patch
38 ];
39
40 nativeBuildInputs = [ setuptools-scm ];
41
42 propagatedBuildInputs = [
43 ansicolors
44 attrs
45 autobahn
46 jinja2
47 pexpect
48 pyserial
49 pyudev
50 pyusb
51 pyyaml
52 requests
53 xmodem
54 ];
55
56 preBuild = ''
57 export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
58 '';
59
60 checkInputs = [
61 mock
62 psutil
63 pytestCheckHook
64 pytest-mock
65 pytest-dependency
66 ];
67
68 meta = with lib; {
69 description = "Embedded control & testing library";
70 homepage = "https://labgrid.org";
71 license = licenses.lgpl21Plus;
72 maintainers = with maintainers; [ emantor ];
73 platforms = with platforms; linux;
74 };
75}