lol

python3Packages.imageio: fix tests

+35 -13
+22 -13
pkgs/development/python-modules/imageio/default.nix
··· 1 1 { lib 2 + , stdenv 2 3 , buildPythonPackage 3 4 , isPy27 4 5 , fetchPypi 5 - , fetchpatch 6 + , substituteAll 6 7 , imageio-ffmpeg 7 8 , numpy 8 9 , pillow 9 10 , psutil 10 11 , pytestCheckHook 11 12 , tifffile 13 + , fsspec 14 + , libGL 12 15 }: 13 16 14 17 buildPythonPackage rec { ··· 21 24 inherit pname version; 22 25 }; 23 26 27 + patches = [ 28 + (substituteAll { 29 + src = ./libgl-path.patch; 30 + libgl = "${libGL.out}/lib/libGL${stdenv.hostPlatform.extensions.sharedLibrary}"; 31 + }) 32 + ]; 33 + 24 34 propagatedBuildInputs = [ 25 35 imageio-ffmpeg 26 36 numpy ··· 28 38 ]; 29 39 30 40 checkInputs = [ 41 + fsspec 31 42 psutil 32 43 pytestCheckHook 33 44 tifffile 34 45 ]; 35 46 47 + pytestFlagsArray = [ 48 + "-m 'not needs_internet'" 49 + ]; 50 + 36 51 preCheck = '' 37 52 export IMAGEIO_USERDIR="$TMP" 38 - export IMAGEIO_NO_INTERNET="true" 39 - export HOME="$(mktemp -d)" 53 + export HOME=$TMPDIR 40 54 ''; 41 55 42 - disabledTests = [ 43 - # tries to pull remote resources, even with IMAGEIO_NO_INTERNET 44 - "test_png_remote" 45 - # needs git history 46 - "test_mvolread_out_of_bytes" 47 - "test_imiter" 48 - "test_memory_size" 49 - "test_legacy_write_empty" 50 - ]; 51 - 52 56 disabledTestPaths = [ 57 + # tries to fetch fixtures over the network 58 + "tests/test_freeimage.py" 53 59 "tests/test_pillow.py" 60 + "tests/test_spe.py" 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 + maintainers = with maintainers; [ ]; 60 69 }; 61 70 }
+13
pkgs/development/python-modules/imageio/libgl-path.patch
··· 1 + diff --git a/tests/test_core.py b/tests/test_core.py 2 + index 2cdbb3a..032974c 100644 3 + --- a/tests/test_core.py 4 + +++ b/tests/test_core.py 5 + @@ -129,7 +129,7 @@ def test_findlib2(): 6 + open(os.path.join(fi_dir, "notalib.test.so"), "wb") 7 + 8 + # Loading libs 9 + - gllib = ctypes.util.find_library("GL") 10 + + gllib = "@libgl@" 11 + core.load_lib([gllib], []) 12 + # Fail 13 + raises(ValueError, core.load_lib, [], []) # Nothing given