Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / trezor / default.nix
blob7a4403550964f19e9f57765386174f8a2a581154
1 { stdenv
2 , lib
3 , buildPythonPackage
4 , fetchPypi
5 , isPy3k
6 , installShellFiles
7 , attrs
8 , click
9 , construct
10 , construct-classes
11 , ecdsa
12 , hidapi
13 , libusb1
14 , mnemonic
15 , pillow
16 , protobuf
17 , requests
18 , shamir-mnemonic
19 , simple-rlp
20 , typing-extensions
21 , trezor-udev-rules
22 , pytestCheckHook
25 buildPythonPackage rec {
26   pname = "trezor";
27   version = "0.13.8";
28   format = "setuptools";
30   disabled = !isPy3k;
32   src = fetchPypi {
33     inherit pname version;
34     hash = "sha256-Y01O3fNWAyV8MhYY2FSMajWyc4Rle2XjsL261jWlfP8=";
35   };
37   nativeBuildInputs = [ installShellFiles ];
39   propagatedBuildInputs = [
40     attrs
41     click
42     construct
43     construct-classes
44     ecdsa
45     hidapi
46     libusb1
47     mnemonic
48     pillow
49     protobuf
50     requests
51     shamir-mnemonic
52     simple-rlp
53     typing-extensions
54   ] ++ lib.optionals stdenv.isLinux [
55     trezor-udev-rules
56   ];
58   nativeCheckInputs = [ pytestCheckHook ];
60   disabledTestPaths = [
61     "tests/test_stellar.py" # requires stellar-sdk
62     "tests/test_firmware.py" # requires network downloads
63   ];
65   pythonImportsCheck = [ "trezorlib" ];
67   postCheck = ''
68     $out/bin/trezorctl --version
69   '';
71   postFixup = ''
72     mkdir completions
73     _TREZORCTL_COMPLETE=source_bash $out/bin/trezorctl > completions/trezorctl || true
74     _TREZORCTL_COMPLETE=source_zsh $out/bin/trezorctl > completions/_trezorctl || true
75     _TREZORCTL_COMPLETE=source_fish $out/bin/trezorctl > completions/trezorctl.fish || true
76     installShellCompletion --bash completions/trezorctl
77     installShellCompletion --zsh completions/_trezorctl
78     installShellCompletion --fish completions/trezorctl.fish
79   '';
81   meta = with lib; {
82     description = "Python library for communicating with Trezor Hardware Wallet";
83     mainProgram = "trezorctl";
84     homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
85     license = licenses.gpl3;
86     maintainers = with maintainers; [ np prusnak mmahut ];
87   };