tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
python3Packages.imageio: fix tests
Martin Weinelt
4 years ago
8fde457c
7e491988
+37
-15
2 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
imageio
default.nix
libgl-path.patch
+24
-15
pkgs/development/python-modules/imageio/default.nix
reviewed
···
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 {
···
24
21
inherit pname version;
25
22
};
26
23
24
24
+
patches = [
25
25
+
(substituteAll {
26
26
+
src = ./libgl-path.patch;
27
27
+
libgl = "${libGL.out}/lib/libGL${stdenv.hostPlatform.extensions.sharedLibrary}";
28
28
+
})
29
29
+
];
30
30
+
27
31
propagatedBuildInputs = [
28
32
imageio-ffmpeg
29
33
numpy
···
38
28
];
39
29
40
30
checkInputs = [
31
31
+
fsspec
41
32
psutil
42
33
pytestCheckHook
43
34
tifffile
44
35
];
45
36
46
46
-
preCheck = ''
47
47
-
export IMAGEIO_USERDIR="$TMP"
48
48
-
export IMAGEIO_NO_INTERNET="true"
49
49
-
export HOME="$(mktemp -d)"
50
50
-
'';
51
51
-
52
52
-
disabledTests = [
53
53
-
# tries to pull remote resources, even with IMAGEIO_NO_INTERNET
54
54
-
"test_png_remote"
55
55
-
# needs git history
56
56
-
"test_mvolread_out_of_bytes"
57
57
-
"test_imiter"
58
58
-
"test_memory_size"
59
59
-
"test_legacy_write_empty"
37
37
+
pytestFlagsArray = [
38
38
+
"-m 'not needs_internet'"
60
39
];
61
40
41
41
+
preCheck = ''
42
42
+
export IMAGEIO_USERDIR="$TMP"
43
43
+
export HOME=$TMPDIR
44
44
+
'';
45
45
+
62
46
disabledTestPaths = [
47
47
+
# tries to fetch fixtures over the network
48
48
+
"tests/test_freeimage.py"
63
49
"tests/test_pillow.py"
50
50
+
"tests/test_spe.py"
51
51
+
"tests/test_swf.py"
64
52
];
65
53
66
54
meta = with lib; {
67
55
description = "Library for reading and writing a wide range of image, video, scientific, and volumetric data formats";
68
56
homepage = "http://imageio.github.io/";
69
57
license = licenses.bsd2;
58
58
+
maintainers = with maintainers; [ ];
70
59
};
71
60
}
+13
pkgs/development/python-modules/imageio/libgl-path.patch
reviewed
···
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