nixpkgs/pkgs/development/python-modules/labgrid/default.nix
Rouven Czerwinski 7fb99b7216 python3Packages.labgrid: add packaging module
Add missing packaging module, fixes the following backtrace while trying
to use labgrid-client:

  Traceback (most recent call last):
    File "/nix/store/izj1dw63bqh47bq10v1b2d7qqg9al7f7-python3.9-labgrid-0.4.1/bin/.labgrid-client-wrapped", line 6, in <module>
      from labgrid.remote.client import main
    File "/nix/store/izj1dw63bqh47bq10v1b2d7qqg9al7f7-python3.9-labgrid-0.4.1/lib/python3.9/site-packages/labgrid/__init__.py", line 1, in <module>
      from .target import Target
    File "/nix/store/izj1dw63bqh47bq10v1b2d7qqg9al7f7-python3.9-labgrid-0.4.1/lib/python3.9/site-packages/labgrid/target.py", line 9, in <module>
      from .driver import Driver
    File "/nix/store/izj1dw63bqh47bq10v1b2d7qqg9al7f7-python3.9-labgrid-0.4.1/lib/python3.9/site-packages/labgrid/driver/__init__.py", line 4, in <module>
      from .serialdriver import SerialDriver
    File "/nix/store/izj1dw63bqh47bq10v1b2d7qqg9al7f7-python3.9-labgrid-0.4.1/lib/python3.9/site-packages/labgrid/driver/serialdriver.py", line 5, in <module>
      from packaging import version
  ModuleNotFoundError: No module named 'packaging'
2022-04-26 11:21:07 +02:00

78 lines
1.3 KiB
Nix

{ ansicolors
, attrs
, autobahn
, buildPythonPackage
, fetchFromGitHub
, jinja2
, lib
, mock
, packaging
, pexpect
, psutil
, pyserial
, pytestCheckHook
, pytest-dependency
, pytest-mock
, pyudev
, pyusb
, pyyaml
, requests
, setuptools-scm
, xmodem
}:
buildPythonPackage rec {
pname = "labgrid";
version = "0.4.1";
src = fetchFromGitHub {
owner = "labgrid-project";
repo = "labgrid";
rev = "v${version}";
sha256 = "0ih04lh1q3dysps4vfmk2rhqqrsimssadsxvbxdsnim2yihrrw47";
};
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
packaging
pexpect
pyserial
pyudev
pyusb
pyyaml
requests
xmodem
];
preBuild = ''
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
'';
checkInputs = [
mock
psutil
pytestCheckHook
pytest-mock
pytest-dependency
];
meta = with lib; {
description = "Embedded control & testing library";
homepage = "https://labgrid.org";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ emantor ];
platforms = with platforms; linux;
};
}