git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.magic-wormhole: enable tests
commitb09435ea51caaae1865e667aaa32f7cba4cc4ff2 authorRok Garbas <rok@garbas.si> dateSat 26 Nov 2016, 00:34 (10 years ago) parentfdbf7dc
2 files changed+24−12
pkgs/development/python-modules/magic-wormhole/default.nix+21−11 pkgs/top-level/python-packages.nix+3−1
pkgs/development/python-modules/magic-wormhole/default.nix+21−11
@@ -1,7 +1,6 @@
1−{ fetchurl, lib, buildPythonPackage, python, autobahn
2−, cffi, click, hkdf, pynacl, spake2, tqdm }:
1+{ stdenv, fetchurl, nettools, glibcLocales, pythonPackages }:
32
4−buildPythonPackage rec {
3+pythonPackages.buildPythonApplication rec {
54 name = "magic-wormhole-${version}";
65 version = "0.8.1";
76
@@ -9,18 +8,29 @@ buildPythonPackage rec {
98 url = "mirror://pypi/m/magic-wormhole/${name}.tar.gz";
109 sha256 = "1yh5nbhh9z1am2pqnb5qqyq1zjl1m7z6jnkmvry2q14qwspw9had";
1110 };
12− checkPhase = ''
13− ${python.interpreter} -m wormhole.test.run_trial wormhole
11+
12+ buildInputs = [ nettools glibcLocales ];
13+ propagatedBuildInputs = with pythonPackages; [ autobahn cffi click hkdf pynacl spake2 tqdm ];
14+
15+ patchPhase = ''
16+ sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py
17+ sed -i -e "s|if (os.path.dirname(os.path.abspath(wormhole))|if not os.path.abspath(wormhole).startswith('/nix/store') and (os.path.dirname(os.path.abspath(wormhole))|" src/wormhole/test/test_scripts.py
18+ # XXX: disable one test due to warning:
19+ # setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
20+ sed -i -e "s|def test_text_subprocess|def skip_test_text_subprocess|" src/wormhole/test/test_scripts.py
1421 '';
1522
16− # Several test failures, network related.
17− doCheck = false;
23+ checkPhase = ''
24+ export PATH="$PATH:$out/bin"
25+ export LANG="en_US.UTF-8"
26+ export LC_ALL="en_US.UTF-8"
27+ ${pythonPackages.python.interpreter} -m wormhole.test.run_trial wormhole
28+ '';
1829
19− propagatedBuildInputs = [ autobahn cffi click hkdf pynacl spake2 tqdm ];
20− meta = {
30+ meta = with stdenv.lib; {
2131 description = "Securely transfer data between computers";
2232 homepage = "https://github.com/warner/magic-wormhole";
23− license = lib.licenses.mit;
24− maintainers = with lib.maintainers; [ asymmetric ];
33+ license = licenses.mit;
34+ maintainers = with maintainers; [ asymmetric ];
2535 };
2636}
pkgs/top-level/python-packages.nix+3−1
@@ -26273,7 +26273,9 @@ in {
2627326273 };
2627426274 });
2627526275
26276− magic-wormhole = callPackage ../development/python-modules/magic-wormhole {};
26276+ magic-wormhole = callPackage ../development/python-modules/magic-wormhole {
26277+ pythonPackages = self;
26278+ };
2627726279
2627826280 wsgiproxy2 = buildPythonPackage rec {
2627926281 name = "WSGIProxy2-0.4.2";