From 160e914f502df0740a7e04cd477ae0b9d109da58 Mon Sep 17 00:00:00 2001 From: Clemens Fruhwirth Date: Thu, 26 Oct 2017 22:47:21 +0200 Subject: [PATCH 1/4] python-trezor: Move mnemonic dependency to propagatedBuildInputs --- pkgs/development/python-modules/trezor/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/trezor/default.nix b/pkgs/development/python-modules/trezor/default.nix index c473403f53d..cb4b63ade81 100644 --- a/pkgs/development/python-modules/trezor/default.nix +++ b/pkgs/development/python-modules/trezor/default.nix @@ -12,9 +12,9 @@ buildPythonPackage rec { sha256 = "6bdb69fc125ba705854e21163be6c7da3aa17c2a3a84f40b6d8a3f6e4a8cb314"; }; - propagatedBuildInputs = [ protobuf hidapi requests ]; + propagatedBuildInputs = [ protobuf hidapi requests mnemonic ]; - buildInputs = [ ecdsa mnemonic ]; + buildInputs = [ ecdsa ]; # There are no actual tests: "ImportError: No module named tests" doCheck = false; From 65d115dd7decad85a04bea563c6a1b9ff9075adb Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Sat, 28 Oct 2017 13:42:50 +0100 Subject: [PATCH 2/4] python.pkgs.libagent: add missing unidecode lib --- pkgs/development/python-modules/libagent/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/libagent/default.nix b/pkgs/development/python-modules/libagent/default.nix index 5318142fe70..84c0a613854 100644 --- a/pkgs/development/python-modules/libagent/default.nix +++ b/pkgs/development/python-modules/libagent/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchPypi, buildPythonPackage, ed25519, ecdsa -, semver, keepkey, trezor, mnemonic, ledgerblue +, semver, keepkey, trezor, mnemonic, ledgerblue, unidecode }: buildPythonPackage rec { @@ -17,6 +17,10 @@ buildPythonPackage rec { trezor mnemonic ledgerblue ]; + propagatedBuildInputs = [ + unidecode + ]; + meta = with stdenv.lib; { description = "Using hardware wallets as SSH/GPG agent"; homepage = https://github.com/romanz/trezor-agent; From 8ad6b2e862ca6606bdaea46bfc089caf6a019806 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Tue, 7 Nov 2017 17:59:24 +0000 Subject: [PATCH 3/4] python.pkgs.keepkey: 0.7.3 -> 4.0.0 --- .../python-modules/keepkey/default.nix | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/keepkey/default.nix b/pkgs/development/python-modules/keepkey/default.nix index 3e58e9e3e03..9ea6840c4d2 100644 --- a/pkgs/development/python-modules/keepkey/default.nix +++ b/pkgs/development/python-modules/keepkey/default.nix @@ -1,21 +1,25 @@ -{ stdenv, fetchPypi, buildPythonPackage, ecdsa -, mnemonic, protobuf, hidapi }: +{ stdenv, fetchFromGitHub, buildPythonPackage, pytest +, ecdsa , mnemonic, protobuf, hidapi, trezor }: buildPythonPackage rec { name = "${pname}-${version}"; pname = "keepkey"; - version = "0.7.3"; + version = "4.0.0"; - src = fetchPypi { - inherit pname version; - sha256 = "14d2r8dlx997ypgma2k8by90acw7i3l7hfq4gar9lcka0lqfj714"; + src = fetchFromGitHub { + owner = "keepkey"; + repo = "python-keepkey"; + rev = "v${version}"; + sha256 = "144awjkc169z2n1ffirs697y6m97izh3pbh3sjhy3nji7jszh592"; }; - propagatedBuildInputs = [ protobuf hidapi ]; + propagatedBuildInputs = [ protobuf hidapi trezor ]; buildInputs = [ ecdsa mnemonic ]; - # There are no actual tests: "ImportError: No module named tests" + checkInputs = [ pytest ]; + + # tests requires hardware doCheck = false; # Remove impossible dependency constraint From 05f9a3661253c657b156cd3459e99b7c27807829 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Tue, 7 Nov 2017 18:00:57 +0000 Subject: [PATCH 4/4] python.pkgs.libagent: enable tests --- pkgs/development/python-modules/libagent/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/libagent/default.nix b/pkgs/development/python-modules/libagent/default.nix index 84c0a613854..fe12f5ffb19 100644 --- a/pkgs/development/python-modules/libagent/default.nix +++ b/pkgs/development/python-modules/libagent/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchPypi, buildPythonPackage, ed25519, ecdsa -, semver, keepkey, trezor, mnemonic, ledgerblue, unidecode +, semver, keepkey, trezor, mnemonic, ledgerblue, unidecode, mock, pytest }: buildPythonPackage rec { @@ -17,9 +17,13 @@ buildPythonPackage rec { trezor mnemonic ledgerblue ]; - propagatedBuildInputs = [ - unidecode - ]; + propagatedBuildInputs = [ unidecode ]; + + checkInputs = [ mock pytest ]; + + checkPhase = '' + py.test libagent/tests + ''; meta = with stdenv.lib; { description = "Using hardware wallets as SSH/GPG agent";