nixpkgs/pkgs/development/python-modules/trezor/default.nix

85 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, buildPythonPackage
, fetchPypi
, isPy3k
, installShellFiles
, attrs
, click
, construct
, ecdsa
, hidapi
, libusb1
, mnemonic
, pillow
, protobuf
, pyblake2
, requests
, rlp
, shamir-mnemonic
, typing-extensions
, trezor-udev-rules
, pytest
}:
2017-03-11 12:49:23 +00:00
buildPythonPackage rec {
pname = "trezor";
version = "0.12.2";
2017-03-11 12:49:23 +00:00
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "0r0j0y0ii62ppawc8qqjyaq0fkmmb0zk1xb3f9navxp556w2dljv";
2017-03-11 12:49:23 +00:00
};
nativeBuildInputs = [ installShellFiles ];
propagatedBuildInputs = [
attrs
click
construct
ecdsa
hidapi
libusb1
mnemonic
pillow
protobuf
pyblake2
requests
rlp
shamir-mnemonic
typing-extensions
] ++ lib.optionals stdenv.isLinux [
trezor-udev-rules
];
2017-03-11 12:49:23 +00:00
checkInputs = [
pytest
];
# disable test_tx_api.py as it requires being online
checkPhase = ''
runHook preCheck
2019-09-26 16:48:42 +01:00
pytest --pyargs tests --ignore tests/test_tx_api.py
runHook postCheck
'';
2017-03-11 12:49:23 +00:00
postFixup = ''
mkdir completions
_TREZORCTL_COMPLETE=source_bash $out/bin/trezorctl > completions/trezorctl || true
_TREZORCTL_COMPLETE=source_zsh $out/bin/trezorctl > completions/_trezorctl || true
_TREZORCTL_COMPLETE=source_fish $out/bin/trezorctl > completions/trezorctl.fish || true
installShellCompletion --bash completions/trezorctl
installShellCompletion --zsh completions/_trezorctl
installShellCompletion --fish completions/trezorctl.fish
'';
meta = with lib; {
description = "Python library for communicating with Trezor Hardware Wallet";
homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
license = licenses.gpl3;
2020-07-29 11:57:20 +01:00
maintainers = with maintainers; [ np prusnak mmahut _1000101 ];
2017-03-11 12:49:23 +00:00
};
}