1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, poetry-core
5, pytestCheckHook
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "usb-devices";
11 version = "0.4.1";
12 format = "pyproject";
13
14 disabled = pythonOlder "3.9";
15
16 src = fetchFromGitHub {
17 owner = "Bluetooth-Devices";
18 repo = pname;
19 rev = "refs/tags/v${version}";
20 hash = "sha256-9w7YCAEpdptQC0GCnJCEyhZgcHMDIw0alj7q4Y82hmA=";
21 };
22
23 postPatch = ''
24 substituteInPlace pyproject.toml \
25 --replace " --cov=usb_devices --cov-report=term-missing:skip-covered" ""
26 '';
27
28 nativeBuildInputs = [
29 poetry-core
30 ];
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 ];
35
36 pythonImportsCheck = [
37 "usb_devices"
38 ];
39
40 meta = with lib; {
41 description = "Library for for mapping, describing, and resetting USB devices";
42 homepage = "https://github.com/Bluetooth-Devices/usb-devices";
43 changelog = "https://github.com/Bluetooth-Devices/usb-devices/blob/v${version}/CHANGELOG.md";
44 license = with licenses; [ mit ];
45 maintainers = with maintainers; [ fab ];
46 };
47}