1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchPypi,
6 click,
7 construct,
8 construct-classes,
9 cryptography,
10 ecdsa,
11 libusb1,
12 mnemonic,
13 requests,
14 setuptools,
15 shamir-mnemonic,
16 slip10,
17 typing-extensions,
18 trezor-udev-rules,
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "trezor";
24 version = "0.13.10";
25 pyproject = true;
26
27 src = fetchPypi {
28 inherit pname version;
29 hash = "sha256-egtq5GKN0MMaXOtRJYkY2bvdOthROIg3IlgmsijuUE8=";
30 };
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 click
36 construct
37 construct-classes
38 cryptography
39 ecdsa
40 libusb1
41 mnemonic
42 requests
43 shamir-mnemonic
44 slip10
45 typing-extensions
46 ]
47 ++ lib.optionals stdenv.hostPlatform.isLinux [ trezor-udev-rules ];
48
49 nativeCheckInputs = [ pytestCheckHook ];
50
51 disabledTestPaths = [
52 "tests/test_stellar.py" # requires stellar-sdk
53 "tests/test_firmware.py" # requires network downloads
54 ];
55
56 pythonImportsCheck = [ "trezorlib" ];
57
58 postCheck = ''
59 $out/bin/trezorctl --version
60 '';
61
62 meta = with lib; {
63 description = "Python library for communicating with Trezor Hardware Wallet";
64 mainProgram = "trezorctl";
65 homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
66 changelog = "https://github.com/trezor/trezor-firmware/blob/python/v${version}/python/CHANGELOG.md";
67 license = licenses.lgpl3Only;
68 maintainers = with maintainers; [
69 np
70 prusnak
71 mmahut
72 ];
73 };
74}