nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python3Packages.imageio: fix tests

+37 -15
+24 -15
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 { ··· 24 21 inherit pname version; 25 22 }; 26 23 24 + patches = [ 25 + (substituteAll { 26 + src = ./libgl-path.patch; 27 + libgl = "${libGL.out}/lib/libGL${stdenv.hostPlatform.extensions.sharedLibrary}"; 28 + }) 29 + ]; 30 + 27 31 propagatedBuildInputs = [ 28 32 imageio-ffmpeg 29 33 numpy ··· 38 28 ]; 39 29 40 30 checkInputs = [ 31 + fsspec 41 32 psutil 42 33 pytestCheckHook 43 34 tifffile 44 35 ]; 45 36 46 - preCheck = '' 47 - export IMAGEIO_USERDIR="$TMP" 48 - export IMAGEIO_NO_INTERNET="true" 49 - export HOME="$(mktemp -d)" 50 - ''; 51 - 52 - disabledTests = [ 53 - # tries to pull remote resources, even with IMAGEIO_NO_INTERNET 54 - "test_png_remote" 55 - # needs git history 56 - "test_mvolread_out_of_bytes" 57 - "test_imiter" 58 - "test_memory_size" 59 - "test_legacy_write_empty" 37 + pytestFlagsArray = [ 38 + "-m 'not needs_internet'" 60 39 ]; 61 40 41 + preCheck = '' 42 + export IMAGEIO_USERDIR="$TMP" 43 + export HOME=$TMPDIR 44 + ''; 45 + 62 46 disabledTestPaths = [ 47 + # tries to fetch fixtures over the network 48 + "tests/test_freeimage.py" 63 49 "tests/test_pillow.py" 50 + "tests/test_spe.py" 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 + maintainers = with maintainers; [ ]; 70 59 }; 71 60 }
+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