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