nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 construct,
11
12 # tests
13 pytestCheckHook,
14}:
15
16buildPythonPackage rec {
17 pname = "usb-protocol";
18 version = "0.9.2";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "greatscottgadgets";
23 repo = "python-usb-protocol";
24 tag = version;
25 hash = "sha256-lLepd2ja/UBSOARHXVwuCxLCIp0vTpUQBMdR2ovfhq8=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail '"setuptools-git-versioning<2"' "" \
31 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
32 '';
33
34 build-system = [
35 setuptools
36 ];
37
38 dependencies = [ construct ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [
45 "usb_protocol"
46 ];
47
48 meta = {
49 changelog = "https://github.com/greatscottgadgets/python-usb-protocol/releases/tag/${src.tag}";
50 description = "Python library providing utilities, data structures, constants, parsers, and tools for working with the USB protocol";
51 homepage = "https://github.com/greatscottgadgets/python-usb-protocol";
52 license = lib.licenses.bsd3;
53 maintainers = with lib.maintainers; [ carlossless ];
54 };
55}