diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-04-09 18:28:16 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-04-12 18:46:15 +0000 |
commit | fd2e737e0678ee7d8081baef05b305146a2c0034 (patch) | |
tree | ac3e9b27576a0382335532d126f9a66d486bc638 /nixpkgs/pkgs/development/python-modules/labgrid | |
parent | cc207d720b6aa836e256c1ee9842bc739e630a8a (diff) | |
parent | 9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2 (diff) | |
download | nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.gz nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.bz2 nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.lz nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.xz nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.zst nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.zip |
Merge remote-tracking branch 'nixpkgs/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/labgrid')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/labgrid/0001-serialdriver-remove-pyserial-version-check.patch | 33 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/labgrid/default.nix | 80 |
2 files changed, 113 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/labgrid/0001-serialdriver-remove-pyserial-version-check.patch b/nixpkgs/pkgs/development/python-modules/labgrid/0001-serialdriver-remove-pyserial-version-check.patch new file mode 100644 index 000000000000..d3e3082b352d --- /dev/null +++ b/nixpkgs/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/nixpkgs/pkgs/development/python-modules/labgrid/default.nix b/nixpkgs/pkgs/development/python-modules/labgrid/default.nix new file mode 100644 index 000000000000..e9f0eda56cc7 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/labgrid/default.nix @@ -0,0 +1,80 @@ +{ 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.2"; + + src = fetchFromGitHub { + owner = "labgrid-project"; + repo = "labgrid"; + rev = "v${version}"; + sha256 = "sha256-wMYsgZXNP8kTt/x8c4e96BXrbjIZZ6RsH04BfD0zGwo="; + }; + + patches = [ + # Pyserial within Nixpkgs already includes the necessary fix, remove the + # pyserial version check from labgrid. + ./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; + }; +} |