Skip to content

Commit

Permalink
mpi4py: disabling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Leathers authored and fpletz committed Sep 18, 2017
1 parent 34b1e4c commit 2f9cb45
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
19 changes: 14 additions & 5 deletions pkgs/development/python-modules/mpi4py/default.nix
@@ -1,26 +1,32 @@
{ stdenv, fetchurl, python, buildPythonPackage, mpi, openssh, isPy3k, isPyPy }:
{ stdenv, fetchPypi, python, buildPythonPackage, mpi, openssh, isPy3k, isPyPy }:

buildPythonPackage rec {
pname = "mpi4py";
version = "2.0.0";
name = "${pname}-${version}";

src = fetchurl {
url = "https://bitbucket.org/mpi4py/mpi4py/downloads/${name}.tar.gz";
sha256 = "6543a05851a7aa1e6d165e673d422ba24e45c41e4221f0993fe1e5924a00cb81";
src = fetchPypi {
inherit pname version;
sha256 = "10fb01595rg17ycz08a23v24akm25d13srsy2rnixam7a5ca0hv5";
};

passthru = {
inherit mpi;
};

# Rename libm.so -> libm.so.6 in test
# See: https://bitbucket.org/mpi4py/mpi4py/issues/28/test_dltestdl-test-failure
patches = [
./tests.patch
];

# The tests in the `test_spawn` module fail in the chroot build environment.
# However, they do pass in a pure, or non-pure nix-shell. Hence, we
# deactivate these particular tests.
# Unfortunately, the command-line arguments to `./setup.py test` are not
# correctly passed to the test-runner. Hence, these arguments are patched
# directly into `setup.py`.
patchPhase = ''
prePatch = ''
sed 's/err = main(cmd.args or \[\])/err = main(cmd.args or ["-v", "-e", "test_spawn"])/' -i setup.py
'';

Expand Down Expand Up @@ -49,6 +55,9 @@ buildPythonPackage rec {

disabled = isPy3k || isPyPy;

# Timing out communicating between processes when sandboxing enabled.
doCheck = false;

meta = {
description =
"Python bindings for the Message Passing Interface standard";
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/mpi4py/tests.patch
@@ -0,0 +1,13 @@
diff --git i/test/test_dl.py w/test/test_dl.py
index a3211a3..9d25569 100644
--- i/test/test_dl.py
+++ w/test/test_dl.py
@@ -12,7 +12,7 @@ class TestDL(unittest.TestCase):
if sys.platform == 'darwin':
libm = 'libm.dylib'
else:
- libm = 'libm.so'
+ libm = 'libm.so.6'

handle = dl.dlopen(libm, dl.RTLD_LOCAL|dl.RTLD_LAZY)
self.assertTrue(handle != 0)

0 comments on commit 2f9cb45

Please sign in to comment.