Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythonPackages.magic-wormhole: enable tests
- Loading branch information
Showing
2 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
32 changes: 21 additions & 11 deletions
32
pkgs/development/python-modules/magic-wormhole/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
{ fetchurl, lib, buildPythonPackage, python, autobahn | ||
, cffi, click, hkdf, pynacl, spake2, tqdm }: | ||
{ stdenv, fetchurl, nettools, glibcLocales, pythonPackages }: | ||
|
||
buildPythonPackage rec { | ||
pythonPackages.buildPythonApplication rec { | ||
name = "magic-wormhole-${version}"; | ||
version = "0.8.1"; | ||
|
||
src = fetchurl { | ||
url = "mirror://pypi/m/magic-wormhole/${name}.tar.gz"; | ||
sha256 = "1yh5nbhh9z1am2pqnb5qqyq1zjl1m7z6jnkmvry2q14qwspw9had"; | ||
}; | ||
checkPhase = '' | ||
${python.interpreter} -m wormhole.test.run_trial wormhole | ||
|
||
buildInputs = [ nettools glibcLocales ]; | ||
propagatedBuildInputs = with pythonPackages; [ autobahn cffi click hkdf pynacl spake2 tqdm ]; | ||
|
||
patchPhase = '' | ||
sed -i -e "s|'ifconfig'|'${nettools}/bin/ifconfig'|" src/wormhole/ipaddrs.py | ||
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 | ||
# XXX: disable one test due to warning: | ||
# setlocale: LC_ALL: cannot change locale (en_US.UTF-8) | ||
sed -i -e "s|def test_text_subprocess|def skip_test_text_subprocess|" src/wormhole/test/test_scripts.py | ||
''; | ||
|
||
# Several test failures, network related. | ||
doCheck = false; | ||
checkPhase = '' | ||
export PATH="$PATH:$out/bin" | ||
export LANG="en_US.UTF-8" | ||
export LC_ALL="en_US.UTF-8" | ||
${pythonPackages.python.interpreter} -m wormhole.test.run_trial wormhole | ||
''; | ||
|
||
propagatedBuildInputs = [ autobahn cffi click hkdf pynacl spake2 tqdm ]; | ||
meta = { | ||
meta = with stdenv.lib; { | ||
description = "Securely transfer data between computers"; | ||
homepage = "https://github.com/warner/magic-wormhole"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ asymmetric ]; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ asymmetric ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters