diff --git a/python-imread-remove-nose.patch b/python-imread-remove-nose.patch deleted file mode 100644 index 6a7b82f..0000000 --- a/python-imread-remove-nose.patch +++ /dev/null @@ -1,441 +0,0 @@ -Index: imread-0.7.4/imread/tests/test_bad.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_bad.py 2020-03-23 13:14:28.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_bad.py 2021-10-27 11:02:52.369127145 +0200 -@@ -1,4 +1,4 @@ --from nose.tools import raises -+import pytest - from imread import imread - from . import file_path - -@@ -34,9 +34,9 @@ BAD_FILES = [ - - ] - def test_read(): -- @raises(RuntimeError) - def read1(fname): -- imread(file_path(fname)) -- assert False -+ with pytest.raises(RuntimeError): -+ imread(file_path(fname)) -+ assert False - for fname in BAD_FILES: - read1(fname) -Index: imread-0.7.4/imread/tests/test_bmp.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_bmp.py 2014-11-06 12:49:53.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_bmp.py 2021-10-27 11:02:52.369127145 +0200 -@@ -1,4 +1,3 @@ --from nose.tools import with_setup, raises - import numpy as np - from imread import imread - from . import file_path -Index: imread-0.7.4/imread/tests/test_error.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_error.py 2014-11-06 12:49:53.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_error.py 2021-10-27 11:02:52.369127145 +0200 -@@ -1,7 +1,7 @@ --from nose.tools import raises -+import pytest - from imread import imread - from . import file_path - --@raises(RuntimeError) - def test_error(): -- imread(file_path('error.unknown')) -+ with pytest.raises(RuntimeError): -+ imread(file_path('error.unknown')) -Index: imread-0.7.4/imread/tests/test_imread_from_blob.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_imread_from_blob.py 2014-10-02 15:20:05.000000000 +0200 -+++ imread-0.7.4/imread/tests/test_imread_from_blob.py 2021-10-27 11:02:52.369127145 +0200 -@@ -1,19 +1,26 @@ -+import pytest - import imread - from imread.imread import imread_from_blob - import numpy as np --def test_imread_from_blob(): -- def compare_with_blob(filename, formatstr): -- from os import path -- filename = path.join( -- path.dirname(__file__), -- 'data', -- filename) -- fromfile= imread.imread(filename) -- fromblob = imread_from_blob(open(filename, 'rb').read(), formatstr) -- assert np.all(fromblob == fromfile) -- yield compare_with_blob, 'good.png', 'png' -- yield compare_with_blob, 'good.png', None -- yield compare_with_blob, 'GOOD.PNG', 'png' -- yield compare_with_blob, 'mono.tif', 'tif' -- yield compare_with_blob, 'mono.tif', 'tiff' -- yield compare_with_blob, 'py-installer-indexed.bmp', 'bmp' -+ -+test_imread_from_blob_data = [ -+ ('good.png', 'png'), -+ ('good.png', None), -+ ('GOOD.PNG', 'png'), -+ ('mono.tif', 'tif'), -+ ('mono.tif', 'tiff'), -+ ('py-installer-indexed.bmp', 'bmp'), -+] -+ -+@pytest.mark.parametrize("filename,formatstr", test_imread_from_blob_data) -+def test_imread_from_blob(filename, formatstr): -+ from os import path -+ filename = path.join( -+ path.dirname(__file__), -+ 'data', -+ filename) -+ fromfile= imread.imread(filename) -+ fromblob = imread_from_blob(open(filename, 'rb').read(), formatstr) -+ assert np.all(fromblob == fromfile) -+ -+ -Index: imread-0.7.4/imread/tests/test_imsave.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_imsave.py 2013-07-12 13:32:33.000000000 +0200 -+++ imread-0.7.4/imread/tests/test_imsave.py 2021-10-27 11:02:52.369127145 +0200 -@@ -1,21 +1,21 @@ -+import pytest - from imread import imsave - import numpy as np --from nose.tools import raises - --@raises(Exception) - def test_non_existing(): -- # in 0.2.5 this led to a hard crash! -- arr = np.arange(64,dtype=np.uint8).reshape((8,8)) -- imsave('/tmp/test-me.png', arr, 'some format which does not exist') -+ with pytest.raises(Exception): -+ # in 0.2.5 this led to a hard crash! -+ arr = np.arange(64,dtype=np.uint8).reshape((8,8)) -+ imsave('/tmp/test-me.png', arr, 'some format which does not exist') - - --@raises(TypeError) - def test_bad_args(): -- arr = np.arange(64,dtype=np.uint8).reshape((8,8)) -- imsave('/tmp/test-me.png', arr, arr) -+ with pytest.raises(TypeError): -+ arr = np.arange(64,dtype=np.uint8).reshape((8,8)) -+ imsave('/tmp/test-me.png', arr, arr) - - --@raises(TypeError) - def test_save_float(): -- im = (np.arange(64*64).reshape((64,64)) % 32 ) * 2. -- imsave('test.jpeg', im) -+ with pytest.raises(TypeError): -+ im = (np.arange(64*64).reshape((64,64)) % 32 ) * 2. -+ imsave('test.jpeg', im) -Index: imread-0.7.4/imread/tests/test_jpeg.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_jpeg.py 2014-11-06 12:49:53.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_jpeg.py 2021-10-27 11:03:59.277512460 +0200 -@@ -1,22 +1,23 @@ --from nose.tools import with_setup, raises -+import pytest - import numpy as np - from imread import imread, imsave - from . import file_path -+import glob -+ - _filename = 'imread_testing_file.jpg' - --def remove_files(filelist): -- def perform_removal(): -- from os import unlink -- for f in filelist: -- try: -- unlink(f) -- except: -- pass -- def wrap(f): -- return with_setup(teardown=perform_removal)(f) -- return wrap -+@pytest.fixture(autouse=True) -+def _remove_files(): -+ yield -+ from os import unlink -+ from glob import glob -+ filelist = glob("*.jpg") -+ for f in filelist: -+ try: -+ unlink(f) -+ except: -+ pass - --@remove_files([_filename]) - def test_jpeg(): - f = np.arange(64*16).reshape((64,16)) - f %= 16 -@@ -26,17 +27,15 @@ def test_jpeg(): - assert np.mean(np.abs(f.astype(float)-g)) < 1. - - --@raises(RuntimeError) - def test_error(): -- imread(file_path('error.jpg')) -+ with pytest.raises(RuntimeError): -+ imread(file_path('error.jpg')) - --@raises(OSError) - def test_error_noent(): -- imread(file_path('this-file-does-not-exist.jpeg')) -- -+ with pytest.raises(OSError): -+ imread(file_path('this-file-does-not-exist.jpeg')) - - --@remove_files(['imread_def.jpg', 'imread_def91.jpg']) - def test_quality(): - def pixel_diff(a): - return np.mean(np.abs(a.astype(float) - data)) -Index: imread-0.7.4/imread/tests/test_png.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_png.py 2018-02-15 14:49:09.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_png.py 2021-10-27 11:02:52.369127145 +0200 -@@ -1,10 +1,11 @@ --from nose.tools import with_setup, raises -+import pytest - import numpy as np - from . import file_path - from imread import imread, imsave - - _filename = 'imread_testing_file.png' - -+@pytest.fixture(autouse=True) - def _remove_file(): - from os import unlink - try: -@@ -12,7 +13,7 @@ def _remove_file(): - except: - pass - --@with_setup(teardown=_remove_file) -+ - def test_png_raw(): - simple = np.arange(16*16).reshape((16,16)) - simple = simple.astype(np.uint8) -@@ -20,7 +21,6 @@ def test_png_raw(): - back = imread(_filename) - assert np.all(simple == back) - --@with_setup(teardown=_remove_file) - def test_asym(): - simple = np.arange(16*16).reshape((32,8)) - simple = simple.astype(np.uint8) -@@ -28,7 +28,6 @@ def test_asym(): - back = imread(_filename) - assert np.all(simple == back) - --@with_setup(teardown=_remove_file) - def test_random(): - np.random.seed(23) - for i in range(8): -@@ -42,7 +41,6 @@ def test_random(): - assert np.all(simple == back) - - --@with_setup(teardown=_remove_file) - def test_non_carray(): - np.random.seed(87) - simple = np.random.random_sample((128,128,3)) -@@ -58,9 +56,9 @@ def test_binary(): - f = imread(file_path('bit1.png')) - assert f.dtype == np.bool_ - --@raises(RuntimeError) - def test_error(): -- imread(file_path('error.png')) -+ with pytest.raises(RuntimeError): -+ imread(file_path('error.png')) - - def test_regression(): - im = imread(file_path('palette_zero.png')) -@@ -73,7 +71,6 @@ def test_16bit(): - assert np.all(f.ravel() == np.arange(512)) - - --@with_setup(teardown=_remove_file) - def test_write_16bit(): - f = np.arange(100000, dtype=np.uint16)*1000 - f = f.reshape((100,-1)) -@@ -81,7 +78,6 @@ def test_write_16bit(): - f2 = imread(_filename) - assert np.all(f == f2) - --@with_setup(teardown=_remove_file) - def test_write_16bit_rgb(): - f = np.random.random((16,8,3)) * 65535.0 - f = f.astype(np.uint16) -Index: imread-0.7.4/imread/tests/test_tiff.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_tiff.py 2019-05-03 17:35:10.000000000 +0200 -+++ imread-0.7.4/imread/tests/test_tiff.py 2021-10-27 11:02:52.373127167 +0200 -@@ -1,10 +1,11 @@ --from nose.tools import with_setup, raises -+import pytest - import numpy as np - from imread import imread, imsave, imread_multi, imsave_multi - from . import file_path - - _filename = 'imread_testing_file.tiff' - -+@pytest.fixture(autouse=True) - def _remove_file(): - from os import unlink - try: -@@ -12,12 +13,11 @@ def _remove_file(): - except: - pass - --@raises(RuntimeError) - def test_error(): -- imread(file_path('error.tif')) -+ with pytest.raises(RuntimeError): -+ imread(file_path('error.tif')) - - --@with_setup(teardown=_remove_file) - def test_read_back(): - simple = np.arange(16*16).reshape((16,16)) - simple = simple.astype(np.uint8) -@@ -25,7 +25,6 @@ def test_read_back(): - back = imread(_filename) - assert np.all(simple == back) - --@with_setup(teardown=_remove_file) - def test_read_back_16(): - np.random.seed(21) - simple = np.random.random_sample((128,128)) -@@ -46,7 +45,6 @@ def test_monochrome(): - def test_multi(): - assert len(imread_multi(file_path('stack.tiff'))) == 2 - --@with_setup(teardown=_remove_file) - def test_read_back_with_metadata(): - simple = np.arange(16*16).reshape((16,16)) - simple = simple.astype(np.uint8) -@@ -57,7 +55,6 @@ def test_read_back_with_metadata(): - assert meta == meta_read - - --@with_setup(teardown=_remove_file) - def test_read_back_colour(): - im = np.arange(256).astype(np.uint8).reshape((32,-1)) - im = np.dstack([im, im*0, 255-im]) -@@ -66,7 +63,6 @@ def test_read_back_colour(): - assert im.shape == im2.shape - assert np.all(im == im2) - --@with_setup(teardown=_remove_file) - def test_read_back_colour_16bit(): - im = np.random.random((16,8,3)) * 65535.0 - im = im.astype(np.uint16) -@@ -75,7 +71,6 @@ def test_read_back_colour_16bit(): - assert im.shape == im2.shape - assert np.all(im == im2) - --@with_setup(teardown=_remove_file) - def test_horizontal_predictor(): - im = imread(file_path('arange512_16bit.png')) - im2 = im.copy() -@@ -85,7 +80,6 @@ def test_horizontal_predictor(): - im3 = imread(_filename) - assert np.all(im == im3) - --@with_setup(teardown=_remove_file) - def test_imsave_multi(): - im = imread(file_path('arange512_16bit.png')) - im2 = im[::4, ::4] -Index: imread-0.7.4/imread/tests/test_webp.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_webp.py 2016-03-14 00:08:13.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_webp.py 2021-10-27 11:02:52.373127167 +0200 -@@ -1,7 +1,7 @@ --from nose.tools import raises -+import pytest - from imread import imread - from . import file_path - --@raises(RuntimeError) - def test_error(): -- imread(file_path('error.webp')) -+ with pytest.raises(RuntimeError): -+ imread(file_path('error.webp')) -Index: imread-0.7.4/imread/tests/test_xcf.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_xcf.py 2014-11-06 12:49:53.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_xcf.py 2021-10-27 11:03:28.577335667 +0200 -@@ -1,7 +1,7 @@ - import sys -+import pytest - from imread import imread - from . import file_path --from nose import SkipTest - - def has_xcf2png(): - # there is no native xcf2png utility for Windows -@@ -16,9 +16,8 @@ def has_xcf2png(): - return (c is not None) - - -+@pytest.mark.skipif(not has_xcf2png(), reason="do not have xcf2png utility") - def test_xcf(): -- if not has_xcf2png(): -- raise SkipTest - im = imread(file_path('diag.xcf')) - assert im.shape == (8, 8, 3) - assert im.max(2).diagonal().sum() == 0 -Index: imread-0.7.4/imread/tests/__init__.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/__init__.py 2014-11-06 12:49:53.000000000 +0100 -+++ imread-0.7.4/imread/tests/__init__.py 2021-10-27 11:05:16.893959432 +0200 -@@ -1,13 +1,3 @@ --def run(verbose=False): -- import nose -- from os import path -- currentdir = path.dirname(__file__) -- updir = path.join(currentdir, '..') -- argv = ['', '--exe', '-w', updir] -- if verbose: -- argv.append('--verbose') -- nose.run('imread', argv=argv) -- - def file_path(fname): - from os import path - return path.join( -Index: imread-0.7.4/imread/tests/test_imread.py -=================================================================== ---- imread-0.7.4.orig/imread/tests/test_imread.py 2014-11-06 12:49:53.000000000 +0100 -+++ imread-0.7.4/imread/tests/test_imread.py 2021-10-27 11:39:35.625815357 +0200 -@@ -1,4 +1,4 @@ --from nose.tools import raises -+import pytest - from . import file_path - from imread import imread - -@@ -10,9 +10,9 @@ def test_uppercase(): - f = imread(file_path('GOOD.PNG')) - assert f.shape == (2,2) - --@raises(ValueError) - def test_no_ext(): -- imread('file_without_extension') -+ with pytest.raises(ValueError): -+ imread('file_without_extension') - - - def test_formatstr(): -Index: imread-0.7.4/setup.py -=================================================================== ---- imread-0.7.4.orig/setup.py 2020-03-31 12:21:51.000000000 +0200 -+++ imread-0.7.4/setup.py 2021-10-27 11:02:56.769152484 +0200 -@@ -153,5 +153,4 @@ setuptools.setup(name = 'imread', - cmdclass = {'build_ext': build_ext}, - setup_requires = ['numpy'], - install_requires = ['numpy'], -- test_suite = 'nose.collector', - ) diff --git a/python-imread.changes b/python-imread.changes index 4a7a79e..e03f3dd 100644 --- a/python-imread.changes +++ b/python-imread.changes @@ -3,6 +3,7 @@ Sat Jan 6 21:05:08 UTC 2024 - Dirk Müller - update to 0.7.5: * Fix build issue +- drop python-imread-remove-nose.patch (upstream) ------------------------------------------------------------------- Wed Oct 27 10:04:03 UTC 2021 - pgajdos@suse.com