1{ lib, fetchPypi, buildPythonPackage, isPy3k, python, pytest
2, typing-extensions
3, protobuf
4, hidapi
5, ecdsa
6, mnemonic
7, requests
8, pyblake2
9, click
10, construct
11, libusb1
12, rlp
13, shamir-mnemonic
14}:
15
16buildPythonPackage rec {
17 pname = "trezor";
18 version = "0.11.4";
19
20 disabled = !isPy3k;
21
22 src = fetchPypi {
23 inherit pname version;
24 sha256 = "aeb3f56a4c389495617f27bf218471b7969f636d25ddc491dfefeb8a1b3cd499";
25 };
26
27 propagatedBuildInputs = [ typing-extensions protobuf hidapi ecdsa mnemonic requests pyblake2 click construct libusb1 rlp shamir-mnemonic ];
28
29 checkInputs = [
30 pytest
31 ];
32
33 # disable test_tx_api.py as it requires being online
34 checkPhase = ''
35 runHook preCheck
36 ${python.interpreter} -m pytest --pyargs trezorlib.tests.unit_tests --ignore trezorlib/tests/unit_tests/test_tx_api.py
37 runHook postCheck
38 '';
39
40 meta = with lib; {
41 description = "Python library for communicating with TREZOR Bitcoin Hardware Wallet";
42 homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
43 license = licenses.gpl3;
44 maintainers = with maintainers; [ np prusnak mmahut maintainers."1000101" ];
45 };
46}