tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
python3Packages.imageio: fix tests
Martin Weinelt
4 years ago
8fde457c
7e491988
+35
-13
2 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
imageio
default.nix
libgl-path.patch
+22
-13
pkgs/development/python-modules/imageio/default.nix
···
1
1
{ lib
2
2
+
, stdenv
2
3
, buildPythonPackage
3
4
, isPy27
4
5
, fetchPypi
5
5
-
, fetchpatch
6
6
+
, substituteAll
6
7
, imageio-ffmpeg
7
8
, numpy
8
9
, pillow
9
10
, psutil
10
11
, pytestCheckHook
11
12
, tifffile
13
13
+
, fsspec
14
14
+
, libGL
12
15
}:
13
16
14
17
buildPythonPackage rec {
···
21
24
inherit pname version;
22
25
};
23
26
27
27
+
patches = [
28
28
+
(substituteAll {
29
29
+
src = ./libgl-path.patch;
30
30
+
libgl = "${libGL.out}/lib/libGL${stdenv.hostPlatform.extensions.sharedLibrary}";
31
31
+
})
32
32
+
];
33
33
+
24
34
propagatedBuildInputs = [
25
35
imageio-ffmpeg
26
36
numpy
···
28
38
];
29
39
30
40
checkInputs = [
41
41
+
fsspec
31
42
psutil
32
43
pytestCheckHook
33
44
tifffile
34
45
];
35
46
47
47
+
pytestFlagsArray = [
48
48
+
"-m 'not needs_internet'"
49
49
+
];
50
50
+
36
51
preCheck = ''
37
52
export IMAGEIO_USERDIR="$TMP"
38
38
-
export IMAGEIO_NO_INTERNET="true"
39
39
-
export HOME="$(mktemp -d)"
53
53
+
export HOME=$TMPDIR
40
54
'';
41
55
42
42
-
disabledTests = [
43
43
-
# tries to pull remote resources, even with IMAGEIO_NO_INTERNET
44
44
-
"test_png_remote"
45
45
-
# needs git history
46
46
-
"test_mvolread_out_of_bytes"
47
47
-
"test_imiter"
48
48
-
"test_memory_size"
49
49
-
"test_legacy_write_empty"
50
50
-
];
51
51
-
52
56
disabledTestPaths = [
57
57
+
# tries to fetch fixtures over the network
58
58
+
"tests/test_freeimage.py"
53
59
"tests/test_pillow.py"
60
60
+
"tests/test_spe.py"
61
61
+
"tests/test_swf.py"
54
62
];
55
63
56
64
meta = with lib; {
57
65
description = "Library for reading and writing a wide range of image, video, scientific, and volumetric data formats";
58
66
homepage = "http://imageio.github.io/";
59
67
license = licenses.bsd2;
68
68
+
maintainers = with maintainers; [ ];
60
69
};
61
70
}
+13
pkgs/development/python-modules/imageio/libgl-path.patch
···
1
1
+
diff --git a/tests/test_core.py b/tests/test_core.py
2
2
+
index 2cdbb3a..032974c 100644
3
3
+
--- a/tests/test_core.py
4
4
+
+++ b/tests/test_core.py
5
5
+
@@ -129,7 +129,7 @@ def test_findlib2():
6
6
+
open(os.path.join(fi_dir, "notalib.test.so"), "wb")
7
7
+
8
8
+
# Loading libs
9
9
+
- gllib = ctypes.util.find_library("GL")
10
10
+
+ gllib = "@libgl@"
11
11
+
core.load_lib([gllib], [])
12
12
+
# Fail
13
13
+
raises(ValueError, core.load_lib, [], []) # Nothing given