python312Packages.usb-protocol: init at 0.9.1

This commit is contained in:
Karolis Stasaitis 2024-11-13 09:11:54 +01:00
parent 7fb7b900cd
commit e0f9d1953a
2 changed files with 59 additions and 0 deletions

View File

@ -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 ];
};
}

View File

@ -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 { };