From e0f9d1953abf7648eeb37d989e1ea94211a1e0f7 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:11:54 +0100 Subject: [PATCH] python312Packages.usb-protocol: init at 0.9.1 --- .../python-modules/usb-protocol/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/usb-protocol/default.nix diff --git a/pkgs/development/python-modules/usb-protocol/default.nix b/pkgs/development/python-modules/usb-protocol/default.nix new file mode 100644 index 000000000000..fa21782fc1cc --- /dev/null +++ b/pkgs/development/python-modules/usb-protocol/default.nix @@ -0,0 +1,57 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + pythonOlder, + + # build-system + setuptools, + + # dependencies + construct, + + # tests + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "usb-protocol"; + version = "0.9.1"; + pyproject = true; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = "python-usb-protocol"; + rev = "refs/tags/${version}"; + hash = "sha256-CYbXs/SRC1FAVEzfw0gwf6U0qQ9Q34nyuj5yfjHfDn8="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-git-versioning<2"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ construct ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "usb_protocol" + ]; + + meta = { + changelog = "https://github.com/greatscottgadgets/python-usb-protocol/releases/tag/${version}"; + description = "Python library providing utilities, data structures, constants, parsers, and tools for working with the USB protocol"; + homepage = "https://github.com/greatscottgadgets/python-usb-protocol"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ carlossless ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5aae1adaa87e..01f963d45cbc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17308,6 +17308,8 @@ self: super: with self; { usb-monitor = callPackage ../development/python-modules/usb-monitor { }; + usb-protocol = callPackage ../development/python-modules/usb-protocol { }; + usbrelay-py = callPackage ../os-specific/linux/usbrelay/python.nix { }; usbtmc = callPackage ../development/python-modules/usbtmc { };