From 6b37a9c2dce567da872dbf824cda50cb784f913f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 27 Nov 2022 10:46:13 +0100 Subject: [PATCH] python310Packages.usb-devices: init at 0.4.1 --- .../python-modules/usb-devices/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/usb-devices/default.nix diff --git a/pkgs/development/python-modules/usb-devices/default.nix b/pkgs/development/python-modules/usb-devices/default.nix new file mode 100644 index 000000000000..ac63251a72d1 --- /dev/null +++ b/pkgs/development/python-modules/usb-devices/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "usb-devices"; + version = "0.4.1"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "Bluetooth-Devices"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-9w7YCAEpdptQC0GCnJCEyhZgcHMDIw0alj7q4Y82hmA="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov=usb_devices --cov-report=term-missing:skip-covered" "" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "usb_devices" + ]; + + meta = with lib; { + description = "Library for for mapping, describing, and resetting USB devices"; + homepage = "https://github.com/Bluetooth-Devices/usb-devices"; + changelog = "https://github.com/Bluetooth-Devices/usb-devices/blob/v${version}/CHANGELOG.md"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8e25b0335c61..870294ca8371 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11653,6 +11653,8 @@ self: super: with self; { urwid-readline = callPackage ../development/python-modules/urwid-readline { }; + usb-devices = callPackage ../development/python-modules/usb-devices { }; + usbrelay-py = callPackage ../os-specific/linux/usbrelay/python.nix { }; usbtmc = callPackage ../development/python-modules/usbtmc { };