summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRouven Czerwinski <rouven@czerwinskis.de>2021-01-24 21:07:19 +0100
committerRouven Czerwinski <rouven@czerwinskis.de>2021-02-17 14:06:49 +0100
commit66936d3a2cf22905da05551a9a17c11c8c7eadce (patch)
tree24c0ddba056b5600e7715dd0a56d71e46459671e /pkgs
parenta7a61998e9a5da33c7540486cc0616271f5e5f73 (diff)
downloadnixpkgs-66936d3a2cf22905da05551a9a17c11c8c7eadce.tar
nixpkgs-66936d3a2cf22905da05551a9a17c11c8c7eadce.tar.gz
nixpkgs-66936d3a2cf22905da05551a9a17c11c8c7eadce.tar.bz2
nixpkgs-66936d3a2cf22905da05551a9a17c11c8c7eadce.tar.lz
nixpkgs-66936d3a2cf22905da05551a9a17c11c8c7eadce.tar.xz
nixpkgs-66936d3a2cf22905da05551a9a17c11c8c7eadce.tar.zst
nixpkgs-66936d3a2cf22905da05551a9a17c11c8c7eadce.zip
python3Packages.labgrid: init at 0.3.1
Labgrid is an embedded control and testing library, this package
packages the minimum to let the client and core-library work.

Signed-off-by: Rouven Czerwinski <rouven@czerwinskis.de>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/labgrid/0001-serialdriver-remove-pyserial-version-check.patch33
-rw-r--r--pkgs/development/python-modules/labgrid/default.nix78
-rw-r--r--pkgs/top-level/python-packages.nix2
3 files changed, 113 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/labgrid/0001-serialdriver-remove-pyserial-version-check.patch b/pkgs/development/python-modules/labgrid/0001-serialdriver-remove-pyserial-version-check.patch
new file mode 100644
index 00000000000..d3e3082b352
--- /dev/null
+++ b/pkgs/development/python-modules/labgrid/0001-serialdriver-remove-pyserial-version-check.patch
@@ -0,0 +1,33 @@
+From 75baa1751973378cb96fb204b0a18a74e5caa2d1 Mon Sep 17 00:00:00 2001
+From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+Date: Wed, 17 Feb 2021 14:03:20 +0100
+Subject: [PATCH] serialdriver: remove pyserial version check
+
+This check isn't required on NixOS, since pyserial within NixOS already
+contains the patches.
+
+Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+---
+ labgrid/driver/serialdriver.py | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/labgrid/driver/serialdriver.py b/labgrid/driver/serialdriver.py
+index 126f674e..59a92269 100644
+--- a/labgrid/driver/serialdriver.py
++++ b/labgrid/driver/serialdriver.py
+@@ -27,12 +27,6 @@ class SerialDriver(ConsoleExpectMixin, Driver, ConsoleProtocol):
+         bindings = {"port": "SerialPort", }
+     else:
+         bindings = {"port": {"SerialPort", "NetworkSerialPort"}, }
+-    if version.parse(serial.__version__) != version.Version('3.4.0.1'):
+-        message = ("The installed pyserial version does not contain important RFC2217 fixes.\n"
+-                   "You can install the labgrid fork via:\n"
+-                   "pip uninstall pyserial\n"
+-                   "pip install https://github.com/labgrid-project/pyserial/archive/v3.4.0.1.zip#egg=pyserial\n")  # pylint: disable=line-too-long
+-        warnings.warn(message)
+ 
+     txdelay = attr.ib(default=0.0, validator=attr.validators.instance_of(float))
+     timeout = attr.ib(default=3.0, validator=attr.validators.instance_of(float))
+-- 
+2.30.0
+
diff --git a/pkgs/development/python-modules/labgrid/default.nix b/pkgs/development/python-modules/labgrid/default.nix
new file mode 100644
index 00000000000..9d42d97e0d8
--- /dev/null
+++ b/pkgs/development/python-modules/labgrid/default.nix
@@ -0,0 +1,78 @@
+{ ansicolors
+, attrs
+, autobahn
+, buildPythonPackage
+, fetchFromGitHub
+, jinja2
+, lib
+, mock
+, pexpect
+, psutil
+, pyserial
+, pytestCheckHook
+, pytest-dependency
+, pytest-mock
+, pyudev
+, pyusb
+, pyyaml
+, requests
+, setuptools-scm
+, xmodem
+}:
+
+buildPythonPackage rec {
+  pname = "labgrid";
+  version = "0.3.1";
+
+  src = fetchFromGitHub {
+    owner = "labgrid-project";
+    repo = "labgrid";
+    rev = "v${version}";
+    sha256 = "15298prs2f4wiyn8lf475qicp3y22lcjdcpwp2fmrya642vnr6w5";
+  };
+
+  patches = [
+    ./0001-serialdriver-remove-pyserial-version-check.patch
+  ];
+
+  nativeBuildInputs = [ setuptools-scm ];
+
+  propagatedBuildInputs = [
+    ansicolors
+    attrs
+    autobahn
+    jinja2
+    pexpect
+    pyserial
+    pyudev
+    pyusb
+    pyyaml
+    requests
+    xmodem
+  ];
+
+  preBuild = ''
+    export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
+  '';
+
+  checkInputs = [
+    mock
+    psutil
+    pytestCheckHook
+    pytest-mock
+    pytest-dependency
+  ];
+
+  disabledTests = [
+    "docker"
+    "sshmanager"
+  ];
+
+  meta = with lib; {
+    description = "Embedded control & testing library";
+    homepage = "https://labgrid.org";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ emantor ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index f217c1a92ab..d64a1ae2391 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -3491,6 +3491,8 @@ in {
 
   labelbox = callPackage ../development/python-modules/labelbox { };
 
+  labgrid = callPackage ../development/python-modules/labgrid { };
+
   lammps-cython = callPackage ../development/python-modules/lammps-cython { mpi = pkgs.mpi; };
 
   langcodes = callPackage ../development/python-modules/langcodes { };