diff --git a/.gitignore b/.gitignore index 230c39e..8514617 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ vigra-1.7.0-src.tar.gz /vigra-1.11.0-src-clean.tar.gz /vigra-1.11.1-src.tar.gz /vigra-1.11.1-src-clean.tar.gz +/vigra-1.11.2-src-clean.tar.gz +/vigra-1.12.1-src-clean.tar.gz diff --git a/sources b/sources index 1cc37a4..9592c8d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vigra-1.11.1-src-clean.tar.gz) = 38c500dacf7a8b8bba22bd3aabaacd061589f76331f9ccf17c52096fa82ff510e531f2120326970789e0f22c4584c35fcb7bfc0eaffce80bea28e2f545a0e12f +SHA512 (vigra-1.12.1-src-clean.tar.gz) = e42c2d5ce46c95ebe43c817b2b25336fc94fe4dc13393be5f78916b8911603c96baf5783b8f39aa87bee85c36c8ba51fe947519349f9cae7d272cf70ed58a445 SHA512 (vigra-config.sh) = 03201ad578ff332cb1186bfa9d4871ada509a8322fb07bd38f00e9254b8c7766920621bb617fdebd927714539fe1ca2a56e7a1a8ce91f02bc2e92d3572d47cb9 diff --git a/vigra-1.11.2-nose-to-pytest.patch b/vigra-1.11.2-nose-to-pytest.patch new file mode 100644 index 0000000..6d9d000 --- /dev/null +++ b/vigra-1.11.2-nose-to-pytest.patch @@ -0,0 +1,566 @@ +From 4f801f896a44bcad723a0c253a2a6eb000f50e23 Mon Sep 17 00:00:00 2001 +From: Mark Harfouche +Date: Sat, 30 Sep 2023 15:36:36 -0400 +Subject: [PATCH 1/3] Migrate to pytest + +--- + config/FindVIGRANUMPY_DEPENDENCIES.cmake | 14 +++++++------- + docsrc/installation.dxx | 2 +- + vigranumpy/test/CMakeLists.txt | 10 +++++----- + vigranumpy/test/test_arraytypes.py | 21 ++++++++++++++++----- + 4 files changed, 29 insertions(+), 18 deletions(-) + +diff --git a/config/FindVIGRANUMPY_DEPENDENCIES.cmake b/config/FindVIGRANUMPY_DEPENDENCIES.cmake +index 964ae92..c1a6495 100644 +--- a/config/FindVIGRANUMPY_DEPENDENCIES.cmake ++++ b/config/FindVIGRANUMPY_DEPENDENCIES.cmake +@@ -99,13 +99,13 @@ IF(Python_Interpreter_FOUND) + # + ###################################################################### + execute_process(COMMAND ${Python_EXECUTABLE} -c +- "import nose" +- RESULT_VARIABLE PYTHON_NOSETESTS_NOT_FOUND) ++ "import pytest" ++ RESULT_VARIABLE PYTHON_PYTEST_NOT_FOUND) + +- IF(NOT PYTHON_NOSETESTS_NOT_FOUND) +- MESSAGE(STATUS "Searching for Python nosetests: ok") ++ IF(NOT PYTHON_PYTEST_NOT_FOUND) ++ MESSAGE(STATUS "Searching for Python pytest: ok") + ELSE() +- MESSAGE(STATUS "Could NOT find Python nosetests ('import nose' failed)") ++ MESSAGE(STATUS "Could NOT find Python pytest ('import pytest' failed)") + ENDIF() + + ###################################################################### +@@ -160,8 +160,8 @@ IF(Python_Interpreter_FOUND) + if(TEST_VIGRANUMPY AND NOT VIGRANUMPY_DEPENDENCIES_FOUND) + MESSAGE(FATAL_ERROR " vigranumpy dependencies NOT found while TEST_VIGRANUMPY=1") + endif() +- if(TEST_VIGRANUMPY AND PYTHON_NOSETESTS_NOT_FOUND) +- MESSAGE(FATAL_ERROR " nosetests NOT found while TEST_VIGRANUMPY=1") ++ if(TEST_VIGRANUMPY AND PYTHON_PYTEST_NOT_FOUND) ++ MESSAGE(FATAL_ERROR " pytest NOT found while TEST_VIGRANUMPY=1") + endif() + ELSE() + MESSAGE(STATUS "Python not found. Make sure that Python is in your PATH or set the appropriate variables as described in https://cmake.org/cmake/help/latest/module/FindPython.html") +diff --git a/docsrc/installation.dxx b/docsrc/installation.dxx +index e02e460..b44d21e 100755 +--- a/docsrc/installation.dxx ++++ b/docsrc/installation.dxx +@@ -13,7 +13,7 @@ +
  • doxygen and Python to generate C++ documentation. +
  • Python, boost_python, and numpy to compile and run vigranumpy (the VIGRA Python bindings). +
  • sphinx to generate vigranumpy documentation. +-
  • nosetests to execute the vigranumpy test suite. ++
  • pytest to execute the vigranumpy test suite. + + + These dependencies are optional - the functionality will simply be unavailable if the libraries cannot be found. +diff --git a/vigranumpy/test/CMakeLists.txt b/vigranumpy/test/CMakeLists.txt +index 1c267a5..eca7c5f 100644 +--- a/vigranumpy/test/CMakeLists.txt ++++ b/vigranumpy/test/CMakeLists.txt +@@ -84,7 +84,7 @@ else() + endif() + endif() + +-IF(NOT PYTHON_NOSETESTS_NOT_FOUND) ++IF(NOT PYTHON_PYTEST_NOT_FOUND) + # copy the individual test scripts + FOREACH(test_script ${TEST_SCRIPTS}) + ADD_CUSTOM_COMMAND( +@@ -122,7 +122,7 @@ IF(NOT PYTHON_NOSETESTS_NOT_FOUND) + get_filename_component(PYTHON_PATH ${Python_EXECUTABLE} PATH) + get_filename_component(PYTHON_EXE ${Python_EXECUTABLE} NAME) + SET(EXTRA_PATH "${PYTHON_PATH}${PATHSEP}${EXTRA_PATH}") +- SET(VIGRA_TEST_EXECUTABLE "${PYTHON_EXE} -c \"import nose; nose.main()\" . %CONFIGURATION%") ++ SET(VIGRA_TEST_EXECUTABLE "${PYTHON_EXE} -m pytest . %CONFIGURATION%") + SET(VIGRA_TEST_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/run_vigranumpytest.bat") + CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config/run_test.bat.in + ${VIGRA_TEST_SCRIPT}.in +@@ -130,7 +130,7 @@ IF(NOT PYTHON_NOSETESTS_NOT_FOUND) + file(GENERATE OUTPUT "${VIGRA_TEST_SCRIPT}" + INPUT "${VIGRA_TEST_SCRIPT}.in") + ELSE() +- SET(VIGRA_TEST_EXECUTABLE "${Python_EXECUTABLE} -c \"import nose; nose.main()\" .") ++ SET(VIGRA_TEST_EXECUTABLE "${Python_EXECUTABLE} -m pytest .") + SET(VIGRA_TEST_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/run_vigranumpytest.sh") + CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config/run_test.sh.in + ${VIGRA_TEST_SCRIPT}.in +@@ -161,11 +161,11 @@ IF(NOT PYTHON_NOSETESTS_NOT_FOUND) + if(MSVC AND NOT (MSVC_VERSION VERSION_LESS "11")) + # FIXME: this may not portable between VC versions (works for 11.0 - 14.0) + set(VIGRA_TEST_EXE "${Python_EXECUTABLE}") +- set(VIGRA_TEST_ARGS "-c \"import nose; nose.main()\" . \$(Configuration)") ++ set(VIGRA_TEST_ARGS "-m pytest . \$(Configuration)") + configure_file(${CMAKE_SOURCE_DIR}/config/testdebug.vcxproj.user.in + ${CMAKE_CURRENT_BINARY_DIR}/vigranumpytest.vcxproj.user + @ONLY) + endif() + ELSE() +- MESSAGE(STATUS " vigranumpy tests will NOT be executed (nosetests missing)") ++ MESSAGE(STATUS " vigranumpy tests will NOT be executed (pytest missing)") + ENDIF() +diff --git a/vigranumpy/test/test_arraytypes.py b/vigranumpy/test/test_arraytypes.py +index a0d92be..fb3f7bc 100644 +--- a/vigranumpy/test/test_arraytypes.py ++++ b/vigranumpy/test/test_arraytypes.py +@@ -33,21 +33,19 @@ + # + ####################################################################### + +-# run with a simple 'nosetests' in this directory +-# (and nose installed, i.e. 'easy_install nose') ++# run with a simple 'pytest' in this directory ++# (and pytest installed, i.e. 'pip install pytest' or 'conda install pytest') + + from __future__ import division, print_function + from functools import reduce + + import sys +-print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + # import vigra # FIXME: without this line, C++ constructors don't find VigraArray + import vigra.arraytypes as arraytypes + import vigra.ufunc as ufunc + import numpy, copy + import vigranumpytest as vt +-from nose.tools import assert_equal, raises, assert_true + + from vigra.arraytypes import AxisTags, AxisInfo + import platform +@@ -75,6 +73,19 @@ for n, f in vt.__dict__.items(): + if n.startswith('test'): + allTests.add(n) + ++# 2023/09 ++# Small compatibility shims with old code that used ++# assert_equal and assert_true ++# from nosetest. Rewriting the tests to use python's assert statement ++# was decided to be too invasive. ++def assert_equal(x, y): ++ assert x == y ++ ++ ++def assert_true(x): ++ assert x ++ ++ + def checkShape(shape1, shape2): + assert_equal(shape1, shape2) + +@@ -455,7 +466,7 @@ def checkCompatibility(obj, compatible): + except Exception: + print("exception in %s with shape %s strides %s tags (%s)" % (n, obj.shape, obj.strides, + repr(getattr(obj, "axistags", "none")))) +- raise ++ raise + + def testAxisTags(): + axistags = AxisTags(AxisInfo.c(description="RGB"), +From 980e3b816818cefc7c2ee57e69929126be075c92 Mon Sep 17 00:00:00 2001 +From: Alexandre Detiste +Date: Sun, 4 Aug 2024 00:49:32 +0200 +Subject: [PATCH 2/3] remove more Nose usage + +--- + vigranumpy/test/test1.py | 36 +++++++++++++++--------------- + vigranumpy/test/test2.py | 1 - + vigranumpy/test/test3.py | 3 +-- + vigranumpy/test/test4.py | 13 +++++------ + vigranumpy/test/test_arraytypes.py | 21 ++++++++--------- + vigranumpy/test/test_color.py | 23 ++++++++----------- + vigranumpy/test/test_impex.py | 5 ++--- + vigranumpy/test/test_multidef.py | 2 +- + 8 files changed, 46 insertions(+), 58 deletions(-) + +diff --git a/vigranumpy/test/test1.py b/vigranumpy/test/test1.py +index bd63937..b341e9c 100644 +--- a/vigranumpy/test/test1.py ++++ b/vigranumpy/test/test1.py +@@ -38,7 +38,7 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import assert_equal, raises, assert_raises ++from nose.tools import raises, assert_raises + import vigra + import numpy as np + from vigra.analysis import * +@@ -68,10 +68,10 @@ def checkShape(shape1, shape2): + shape1 = shape1.shape + if isinstance(shape2, np.ndarray): + shape2 = shape2.shape +- assert_equal(shape1, shape2) ++ assert shape1 == shape2 + + def checkType(i,type): +- assert_equal(i.dtype, type) ++ assert i.dtype == type + + def checkAboutSame(i1,i2): + compare_shapes(i1.shape, i2.shape) +@@ -178,8 +178,8 @@ def test_MinimaMaxima(): + + def test_Region2Crack(): + res = regionImageToCrackEdgeImage(img_scalar_i) +- assert_equal(img_scalar_f.shape[0]*2-1, res.shape[0]) +- assert_equal(img_scalar_f.shape[1]*2-1, res.shape[1]) ++ assert img_scalar_f.shape[0]*2-1 == res.shape[0] ++ assert img_scalar_f.shape[1]*2-1 == res.shape[1] + checkType(res,res.dtype) + + regionImageToCrackEdgeImage(img_scalar_i64[0:100,0:100], 1, img_scalar_i64) +@@ -232,8 +232,8 @@ def test_edges(): + checkType(res, np.uint8) + + res = shenCastanCrackEdgeImage(img_scalar_f, 1,128,255) +- assert_equal(img_scalar_f.shape[0]*2-1, res.shape[0]) +- assert_equal(img_scalar_f.shape[1]*2-1, res.shape[1]) ++ assert img_scalar_f.shape[0]*2-1 == res.shape[0] ++ assert img_scalar_f.shape[1]*2-1 == res.shape[1] + + res1 = beautifyCrackEdgeImage(res, 1, 0) + checkShape(res1, res) +@@ -248,29 +248,29 @@ def test_edges(): + checkType(res, np.uint8) + + res = boundaryTensor2D(img_scalar_f, 1) +- assert_equal(img_scalar_f.shape[0], res.shape[0]) +- assert_equal(img_scalar_f.shape[1], res.shape[1]) +- assert_equal(res.shape[2], 3) ++ assert img_scalar_f.shape[0] == res.shape[0] ++ assert img_scalar_f.shape[1] == res.shape[1] ++ assert res.shape[2] == 3 + checkType(res, np.float32) + + res = hourGlassFilter2D(img_multi_f, 1, 2) +- assert_equal(img_multi_f.shape[0], res.shape[0]) +- assert_equal(img_multi_f.shape[1], res.shape[1]) ++ assert img_multi_f.shape[0] == res.shape[0] ++ assert img_multi_f.shape[1] == res.shape[1] + checkType(res, np.float32) + + res = tensorEigenRepresentation2D(img_multi_f) +- assert_equal(img_multi_f.shape[0], res.shape[0]) +- assert_equal(img_multi_f.shape[1], res.shape[1]) ++ assert img_multi_f.shape[0] == res.shape[0] ++ assert img_multi_f.shape[1] == res.shape[1] + checkType(res, np.float32) + + res = tensorTrace(img_multi_f) +- assert_equal(img_multi_f.shape[0], res.shape[0]) +- assert_equal(img_multi_f.shape[1], res.shape[1]) ++ assert img_multi_f.shape[0] == res.shape[0] ++ assert img_multi_f.shape[1] == res.shape[1] + checkType(res, np.float32) + + res = rieszTransformOfLOG2D(img_scalar_f, 1, 1, 1) +- assert_equal(img_multi_f.shape[0], res.shape[0]) +- assert_equal(img_multi_f.shape[1], res.shape[1]) ++ assert img_multi_f.shape[0] == res.shape[0] ++ assert img_multi_f.shape[1] == res.shape[1] + checkType(res, np.float32) + + +diff --git a/vigranumpy/test/test2.py b/vigranumpy/test/test2.py +index dd23543..f5cd64e 100644 +--- a/vigranumpy/test/test2.py ++++ b/vigranumpy/test/test2.py +@@ -38,7 +38,6 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import assert_equal, raises + import numpy as np + from vigra import * + from vigra.filters import * +diff --git a/vigranumpy/test/test3.py b/vigranumpy/test/test3.py +index e13dd81..c86e6a8 100644 +--- a/vigranumpy/test/test3.py ++++ b/vigranumpy/test/test3.py +@@ -38,7 +38,6 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import assert_equal, raises + import numpy as np + from vigra import * + from vigra import arraytypes as at +@@ -67,7 +66,7 @@ def checkShape(shape1, shape2): + shape1 = shape1.shape + if isinstance(shape2, np.ndarray): + shape2 = shape2.shape +- assert_equal(shape1, shape2) ++ assert shape1 == shape2 + + def checkImages(i1,i2): + checkShape(i1.shape, i2.shape) +diff --git a/vigranumpy/test/test4.py b/vigranumpy/test/test4.py +index bf89970..43f1bff 100644 +--- a/vigranumpy/test/test4.py ++++ b/vigranumpy/test/test4.py +@@ -39,7 +39,6 @@ print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + + +-from nose.tools import assert_equal, raises + import numpy as np + import numpy as numpy + from vigra import graphs as vigraph +@@ -273,17 +272,17 @@ class TestGraph(object): + g.addNode(3) + nodes = [n for n in g.nodeIter()] + assert len(nodes)==1 +- assert g.id(nodes[0]) == 3 ++ assert g.id(nodes[0]) == 3 + + g.addNode(6) + nodes = [n for n in g.nodeIter()] + assert len(nodes)==2 +- assert g.id(nodes[0]) == 3 +- assert g.id(nodes[1]) == 6 ++ assert g.id(nodes[0]) == 3 ++ assert g.id(nodes[1]) == 6 + + g.addNode(2) + nodes = [n for n in g.nodeIter()] + assert len(nodes)==3 +- assert g.id(nodes[0]) == 2 +- assert g.id(nodes[1]) == 3 +- assert g.id(nodes[2]) == 6 +\ No newline at end of file ++ assert g.id(nodes[0]) == 2 ++ assert g.id(nodes[1]) == 3 ++ assert g.id(nodes[2]) == 6 +diff --git a/vigranumpy/test/test_arraytypes.py b/vigranumpy/test/test_arraytypes.py +index fb3f7bc..9251b95 100644 +--- a/vigranumpy/test/test_arraytypes.py ++++ b/vigranumpy/test/test_arraytypes.py +@@ -75,16 +75,13 @@ for n, f in vt.__dict__.items(): + + # 2023/09 + # Small compatibility shims with old code that used +-# assert_equal and assert_true ++# assert_equal + # from nosetest. Rewriting the tests to use python's assert statement + # was decided to be too invasive. + def assert_equal(x, y): + assert x == y + + +-def assert_true(x): +- assert x +- + + def checkShape(shape1, shape2): + assert_equal(shape1, shape2) +@@ -177,7 +174,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True): + if channels > 1: + assert_equal(img.order, "V" if hasChannelAxis else "F") + else: +- assert_true(img.order in ['V', 'F']) ++ assert img.order in ['V', 'F'] + assert_equal(img.flags.c_contiguous, False) + + # test axistags +@@ -186,7 +183,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True): + assert_equal(img.withAxes('y', 'z', 'x', 'c').axistags, axistags4) + assert_equal(img.withAxes('yzxc').axistags, axistags4) + assert_equal(img.withAxes(axistags4).axistags, axistags4) +- assert_true(img.withAxes(img.axistags) is img) ++ assert img.withAxes(img.axistags) is img + array = img.noTags() + assert_equal(type(array), numpy.ndarray) + assert_equal(arraytypes.taggedView(array, vaxistags).axistags, vaxistags) +@@ -265,7 +262,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True): + if channels > 1: + assert_equal(img.order, "V" if hasChannelAxis else "F") + else: +- assert_true(img.order in ['V', 'F']) ++ assert img.order in ['V', 'F'] + assert_equal(img.flags.c_contiguous, False) + assert_equal(img.axistags, vaxistags) + img[1,2] = value +@@ -319,7 +316,7 @@ def checkArray(cls, channels, dim, hasChannelAxis=True): + if channels > 1: + assert_equal(img.order, "V" if hasChannelAxis else "F") + else: +- assert_true(img.order in ['V', 'F']) ++ assert img.order in ['V', 'F'] + assert_equal(b.axistags, img.axistags) + assert_equal(b.flags.c_contiguous, False) + assert (b==img).all() +@@ -1379,7 +1376,7 @@ def testSlicing(): + assert_equal(tags, a.axistags) + + b = a[...] +- assert_true((a==b).all()) ++ assert (a==b).all() + assert_equal(tags, b.axistags) + + b = a[...,0] +@@ -1420,17 +1417,17 @@ def testSlicing(): + + b = a.subarray((4,3,2)) + assert_equal(b.shape, (4,3,2,2)) +- assert_true((a[:4,:3,:2,:]==b).all()) ++ assert (a[:4,:3,:2,:]==b).all() + assert_equal(tags, b.axistags) + + b = a.subarray((1,1,1),(4,3,2)) + assert_equal(b.shape, (3,2,1,2)) +- assert_true((a[1:4,1:3,1:2]==b).all()) ++ assert (a[1:4,1:3,1:2]==b).all() + assert_equal(tags, b.axistags) + + b = a.subarray((1,1,1,1),(4,3,2,2)) + assert_equal(b.shape, (3,2,1,1)) +- assert_true((a[1:4,1:3,1:2,1:]==b).all()) ++ assert (a[1:4,1:3,1:2,1:]==b).all() + assert_equal(tags, b.axistags) + + def testMethods(): +diff --git a/vigranumpy/test/test_color.py b/vigranumpy/test/test_color.py +index 5551a97..74139e2 100644 +--- a/vigranumpy/test/test_color.py ++++ b/vigranumpy/test/test_color.py +@@ -38,7 +38,6 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import assert_equal, raises, assert_raises, assert_true + import vigra + import numpy + +@@ -69,8 +68,8 @@ def test_gray2qimage(): + tmp2 = vigra.impex.readImage("tmp2.png") + + for i in range(3): +- assert_true( (tmp1 == tmp2[:,:,i]).all() ) +- assert_true( (tmp2[:,:,3] == 255).all() ) ++ assert (tmp1 == tmp2[:,:,i]).all() ++ assert (tmp2[:,:,3] == 255).all() + + def test_alphamodulated2qimage(): + if not _have_qt: +@@ -93,15 +92,11 @@ def test_alphamodulated2qimage(): + tmp2 = byte_view(img) + tmp2 = tmp2.swapaxes(0,1) + +- assert_true( tmp1.shape[0:2] == tmp2.shape[0:2] ) +- assert_true( tmp2.ndim == 3 ) +- assert_true( tmp2.shape[2] == 4 ) ++ assert tmp1.shape[0:2] == tmp2.shape[0:2] ++ assert tmp2.ndim == 3 ++ assert tmp2.shape[2] == 4 + +- assert_true( (tmp2[:,:,0] == 0).all() ) +- assert_true( (tmp2[:,:,2] == 0).all() ) +- assert_true( (tmp2[:,:,3] == tmp1).all() ) +- assert_true( (tmp2[:,:,1] == tmp1).all() ) +- +-if __name__ == '__main__': +- import nose +- nose.run(defaultTest=__file__) ++ assert (tmp2[:,:,0] == 0).all() ++ assert (tmp2[:,:,2] == 0).all() ++ assert (tmp2[:,:,3] == tmp1).all() ++ assert (tmp2[:,:,1] == tmp1).all() +diff --git a/vigranumpy/test/test_impex.py b/vigranumpy/test/test_impex.py +index 3a2a0f5..0e94d17 100644 +--- a/vigranumpy/test/test_impex.py ++++ b/vigranumpy/test/test_impex.py +@@ -38,7 +38,6 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import assert_equal, raises + import numpy as np + import vigra.vigranumpycore # FIXME: why is this needed? (without, impex returns ndarray) + import vigra.impex as im +@@ -58,11 +57,11 @@ volumeFloat=at.Volume(np.random.rand(3,4,5,6)*100,dtype=np.float32, + axistags=at.VigraArray.defaultAxistags(4, 'C')) + + def checkEqualData(i1,i2): +- assert_equal(i1.shape, i2.shape) ++ assert i1.shape == i2.shape + assert(np.all(i1==i2)) + + def checkUnequalData(i1,i2): +- assert_equal(i1.shape, i2.shape) ++ assert i1.shape == i2.shape + assert(np.any(i1!=i2)) + + def test_multiImageTiff(): +diff --git a/vigranumpy/test/test_multidef.py b/vigranumpy/test/test_multidef.py +index a993a22..ad66846 100644 +--- a/vigranumpy/test/test_multidef.py ++++ b/vigranumpy/test/test_multidef.py +@@ -38,7 +38,7 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import assert_equal, raises, assert_raises ++from nose.tools import assert_raises + import vigra + import numpy as np + +From 2b9b6e2b30f84b441dcc2119e408dac208d04f09 Mon Sep 17 00:00:00 2001 +From: Mark Harfouche +Date: Sun, 4 Aug 2024 12:13:10 -0400 +Subject: [PATCH 3/3] Remove nose as test dependency + +--- + vigranumpy/test/test1.py | 8 +++++++- + vigranumpy/test/test_multidef.py | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/vigranumpy/test/test1.py b/vigranumpy/test/test1.py +index b341e9c..9f556e3 100644 +--- a/vigranumpy/test/test1.py ++++ b/vigranumpy/test/test1.py +@@ -38,13 +38,19 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import raises, assert_raises ++import pytest + import vigra + import numpy as np + from vigra.analysis import * + from vigra.filters import * + import vigra.arraytypes as at + ++# Compatibility for ++# from nose.tools import assert_raises ++def assert_raises(error, func, *args, **kwargs): ++ with pytest.raises(error): ++ func(*args, **kwargs) ++ + img_rgb_f = at.RGBImage(np.random.rand(100,200,3)*255,dtype=np.float32) + img_scalar_f = at.ScalarImage(np.random.rand(100,200)*255,dtype=np.float32) + img_multi_f = at.Vector3Image(np.random.rand(100,200,3)*255,dtype=np.float32) +diff --git a/vigranumpy/test/test_multidef.py b/vigranumpy/test/test_multidef.py +index ad66846..cd7d042 100644 +--- a/vigranumpy/test/test_multidef.py ++++ b/vigranumpy/test/test_multidef.py +@@ -38,10 +38,16 @@ import sys + print("\nexecuting test file", __file__, file=sys.stderr) + exec(compile(open('set_paths.py', "rb").read(), 'set_paths.py', 'exec')) + +-from nose.tools import assert_raises ++import pytest + import vigra + import numpy as np + ++# Compatibility for ++# from nose.tools import assert_raises ++def assert_raises(error, func, *args, **kwargs): ++ with pytest.raises(error): ++ func(*args, **kwargs) ++ + def checkAboutSame(i1,i2): + assert(i1.shape==i2.shape) + difference=np.sum(np.abs(i1-i2))/float(np.size(i1)) diff --git a/vigra-openexr3.patch b/vigra-openexr3.patch new file mode 100644 index 0000000..a4c9b76 --- /dev/null +++ b/vigra-openexr3.patch @@ -0,0 +1,39 @@ +Index: vigra-1.11.1/CMakeLists.txt +=================================================================== +--- vigra-1.11.1.orig/CMakeLists.txt ++++ vigra-1.11.1/CMakeLists.txt +@@ -107,7 +107,22 @@ VIGRA_FIND_PACKAGE(FFTW3F NAMES libfftw3 + + + IF(WITH_OPENEXR) ++ FIND_PACKAGE(Imath CONFIG) ++ IF(TARGET Imath::Imath) ++ FIND_PACKAGE(OpenEXR CONFIG) ++ SET(OPENEXR_LIBRARIES ++ OpenEXR::OpenEXR ++ OpenEXR::Iex ++ OpenEXR::IlmThread ++ Imath::Imath ++ ) ++ get_target_property(OPENEXR_INCLUDE_DIR OpenEXR::OpenEXRConfig INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(IMATH_INCLUDE_DIR Imath::ImathConfig INTERFACE_INCLUDE_DIRECTORIES) ++ include_directories(${OPENEXR_INCLUDE_DIR} ${IMATH_INCLUDE_DIR}) ++ set(OPENEXR_FOUND TRUE) ++ ELSE() + VIGRA_FIND_PACKAGE(OpenEXR) ++ ENDIF() + ENDIF() + + IF(WITH_HDF5) +Index: vigra-1.11.1/src/impex/CMakeLists.txt +=================================================================== +--- vigra-1.11.1.orig/src/impex/CMakeLists.txt ++++ vigra-1.11.1/src/impex/CMakeLists.txt +@@ -85,6 +85,7 @@ IF(TIFF_FOUND) + ENDIF(TIFF_FOUND) + + IF(OPENEXR_FOUND) ++ cmake_policy(SET CMP0028 NEW) + TARGET_LINK_LIBRARIES(vigraimpex ${OPENEXR_LIBRARIES}) + ENDIF(OPENEXR_FOUND) + diff --git a/vigra.spec b/vigra.spec index 18cbdcb..15ba9f3 100644 --- a/vigra.spec +++ b/vigra.spec @@ -1,24 +1,21 @@ Summary: Generic Programming for Computer Vision Name: vigra -Version: 1.11.1 -Release: 16%{?dist} +Version: 1.12.1 +Release: 13%{?dist} License: MIT # The "Lenna" files are non-free, we need to remove them from the source tarball. -# wget https://github.com/ukoethe/vigra/releases/download/Version-1-11-1/vigra-1.11.1-src.tar.gz -# tar xf vigra-1.11.1-src.tar.gz -# find vigra-1.11.1/ -name "lenna*" -delete -# tar zcf vigra-1.11.1-src-clean.tar.gz vigra-1.11.1/ +# wget https://github.com/ukoethe/vigra/archive/refs/tags/Version-1-12-1.tar.gz +# tar -zxvf Version-1-12-1.tar.gz +# mv vigra-Version-1-12-1 vigra-1.12.1 +# find vigra-1.12.1/ -name "lenna*" -delete +# tar zcf vigra-1.12.1-src-clean.tar.gz vigra-1.12.1/ Source0: %{name}-%{version}-src-clean.tar.gz Source1: vigra-config.sh -# Backported from upstream master, fixes a build failure: -# https://github.com/ukoethe/vigra/issues/414 -Patch0: https://github.com/ukoethe/vigra/commit/81958d302494e137f98a8b1d7869841532f90388.patch # Avoid attempt to install non-free 'lenna' files Patch1: vigra-1.10.0-no-lenna.patch Patch2: vigra-1.11.1.docdir.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1597394 -Patch3: vigra-1.11.1.py37.patch URL: http://ukoethe.github.io/vigra/ +BuildRequires: make BuildRequires: gcc-c++ BuildRequires: zlib-devel BuildRequires: libjpeg-devel @@ -31,9 +28,12 @@ BuildRequires: doxygen %if ! 0%{?rhel} Requires: python3 BuildRequires: hdf5-devel +BuildRequires: python3-setuptools BuildRequires: python3-sphinx -BuildRequires: OpenEXR-devel +BuildRequires: cmake(OpenEXR) +BuildRequires: cmake(Imath) BuildRequires: python3-numpy-f2py +BuildRequires: python3-pytest BuildRequires: boost-python3 BuildRequires: boost-python3-devel %else @@ -47,8 +47,6 @@ structures. By using template techniques similar to those in the C++ Standard Template Library, you can easily adapt any VIGRA component to the needs of your application without thereby giving up execution speed. -#' - %package devel Summary: Development tools for programs which will use the vigra library Requires: %{name}%{?_isa} = %{version}-%{release} @@ -87,12 +85,13 @@ sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' \ sed -i 's=SET(BOOST_PYTHON_NAMES=& boost_python%{python3_version_nodots}=' \ config/FindVIGRANUMPY_DEPENDENCIES.cmake -mkdir buildpy3 -pushd buildpy3 -%cmake .. -DWITH_OPENEXR=1 -DWITH_HDF5=1 -DWITH_VALGRIND=0 -DWITH_LEMON=0 \ - -DWITH_VIGRANUMPY=1 -DPYTHON_VERSION=%{python3_version} -make VERBOSE=1 %{?_smp_mflags} -popd +export CXXFLAGS="%{optflags} -DH5_USE_110_API" +%cmake -DWITH_OPENEXR=1 -DWITH_HDF5=1 -DWITH_VALGRIND=0 -DWITH_LEMON=0 \ + -DPYTHON_NUMPY_INCLUDE_DIR=%{_includedir}/numpy \ + -DWITH_VIGRANUMPY=1 -DVIGRANUMPY_INSTALL_DIR=%{python3_sitearch} \ + -DPYTHON_VERSION=%{python3_version} \ + -DCMAKE_CXX_FLAGS="-Wno-template-body %{build_cxxflags}" +%cmake_build %else sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python}=' \ config/vigra-config.in @@ -111,7 +110,7 @@ find ./doc/ -type f | xargs chmod -x rm -rf %{buildroot} %if ! 0%{?rhel} -make -C buildpy3 install DESTDIR=%{buildroot} +%cmake_install mv %{buildroot}/%{_libdir}/vigranumpy/VigranumpyConfig.cmake \ %{buildroot}/%{_libdir}/vigranumpy/Vigranumpy3Config.cmake @@ -119,16 +118,12 @@ mv %{buildroot}/%{_libdir}/vigranumpy/VigranumpyConfig.cmake \ make install DESTDIR=%{buildroot} %endif -rm -rf %{buildroot}/usr/doc +rm -rf %{buildroot}%{_prefix}/doc ( - cd $RPM_BUILD_ROOT%{_bindir} + cd %{buildroot}%{_bindir} mv vigra-config vigra-config-%{__isa_bits} ) -install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/vigra-config - -#fixme: this fails, -#%check -#make VERBOSE=1 check +install -p -m755 -D %{SOURCE1} %{buildroot}%{_bindir}/vigra-config %ldconfig_scriptlets @@ -141,7 +136,7 @@ install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/vigra-config %{_bindir}/vigra-config* %{_libdir}/libvigraimpex.so %{_libdir}/vigra -%doc doc/vigra doc/vigranumpy +%doc doc/vigra %if ! 0%{?rhel} %files -n python3-vigra @@ -150,6 +145,180 @@ install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/vigra-config %endif %changelog +* Wed Jul 22 2026 Python Maint - 1.12.1-13 +- Rebuilt for Python 3.15.0b4 ABI change + +* Fri Jul 17 2026 Fedora Release Engineering - 1.12.1-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + +* Thu Jun 04 2026 Python Maint - 1.12.1-11 +- Rebuilt for Python 3.15 + +* Sun May 31 2026 Richard Shaw - 1.12.1-10 +- Rebuild for OpenColorIO 2.5.2. + +* Mon May 25 2026 Richard Shaw - 1.12.1-9 +- Rebuild for OpenEXR 3.4.12. + +* Fri Apr 17 2026 Orion Poplawski - 1.12.1-8 +- Rebuild for hdf5 2.1 + +* Sat Jan 17 2026 Fedora Release Engineering - 1.12.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Mon Jan 12 2026 Jonathan Wakely - 1.12.1-6 +- Rebuilt for Boost 1.90 + +* Fri Sep 19 2025 Python Maint - 1.12.1-5 +- Rebuilt for Python 3.14.0rc3 bytecode + +* Fri Aug 15 2025 Python Maint - 1.12.1-4 +- Rebuilt for Python 3.14.0rc2 bytecode + +* Fri Jul 25 2025 Fedora Release Engineering - 1.12.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Tue Jun 03 2025 Python Maint - 1.12.1-2 +- Rebuilt for Python 3.14 + +* Wed Jan 08 2025 Bruno Postle - 1.12.1-1 +- Upstream release +- build with -Wno-template-body for gcc15 breakage bug #2341506 + +* Sun Jan 19 2025 Fedora Release Engineering - 1.11.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jan 02 2025 Miro Hrončok - 1.11.2-3 +- Drop a test dependency on deprecated python3-nose +- https://fedoraproject.org/wiki/Changes/DeprecateNose + +* Tue Dec 24 2024 Orion Poplawski - 1.11.2-2 +- Rebuild with numpy 2.x (rhbz#2333964) + +* Sat Nov 30 2024 Bruno Postle - 1.11.2-1 +- Upstream maintenance release +- dropped vigra-1.11.1.py37.patch, 81958d302494e137f98a8b1d7869841532f90388.patch and vigra-openexr3.patch + +* Fri Oct 25 2024 Orion Poplawski - 1.11.1-55 +- Rebuild for hdf5 1.14.5 + +* Sat Jul 20 2024 Fedora Release Engineering - 1.11.1-54 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sun Jun 09 2024 Python Maint - 1.11.1-53 +- Rebuilt for Python 3.13 + +* Wed Apr 24 2024 Benjamin A. Beasley - 1.11.1-52 +- Rebuilt for openexr 3.2.4 + +* Wed Mar 13 2024 Bruno Postle - 1.11.1-51 +- Fixes for the benefit of flatpak builds (yselkowitz) + +* Sat Jan 27 2024 Fedora Release Engineering - 1.11.1-50 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jan 18 2024 Jonathan Wakely - 1.11.1-49 +- Rebuilt for Boost 1.83 + +* Fri Oct 06 2023 Bruno Postle - 1.11.1-48 +- Add python3-nose build dependency, try and avoid numpy.distutils + +* Sat Jul 22 2023 Fedora Release Engineering - 1.11.1-47 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jul 03 2023 Python Maint - 1.11.1-46 +- Rebuilt for Python 3.12 + +* Sat Apr 29 2023 Bruno Postle - 1.11.1-45 +- Python bindings need setuptools (Tomas Hrnciar) + +* Mon Feb 20 2023 Jonathan Wakely - 1.11.1-44 +- Rebuilt for Boost 1.81 + +* Sat Jan 21 2023 Fedora Release Engineering - 1.11.1-43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 1.11.1-42 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 1.11.1-41 +- Rebuilt for Python 3.11 + +* Wed May 04 2022 Thomas Rodgers - 1.11.1-40 +- Rebuilt for Boost 1.78 + +* Sat Jan 22 2022 Fedora Release Engineering - 1.11.1-39 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sun Nov 21 2021 Orion Poplawski - 1.11.1-38 +- Rebuild for hdf5 1.12.1 + +* Sat Aug 21 2021 Richard Shaw - 1.11.1-37 +- Rebuild for OpenEXR/Imath 3.1. + +* Wed Aug 11 2021 Orion Poplawski - 1.11.1-36 +- Rebuild for hdf5 1.10.7 + +* Tue Aug 10 2021 Richard Shaw - 1.11.1-35 +- Fix building with OpenEXR. + +* Tue Aug 10 2021 Richard Shaw - 1.11.1-34.1 +- Rebuild with Imath 3. + +* Tue Aug 10 2021 Orion Poplawski - 1.11.1-33.1 +- Rebuild for hdf5 1.10.7 + +* Fri Aug 06 2021 Jonathan Wakely - 1.11.1-32.1 +- Rebuilt for Boost 1.76 + +* Tue Aug 03 2021 Richard Shaw - 1.11.1-31.1 +- Add patch to link with OpenEXR/Imath 3 properly. + +* Mon Aug 02 2021 Richard Shaw - 1.11.1-31 +- Rebuild for OpenEXR/Imath 3. + +* Fri Jul 23 2021 Fedora Release Engineering - 1.11.1-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 1.11.1-29 +- Rebuilt for Python 3.10 + +* Tue Mar 30 2021 Jonathan Wakely - 1.11.1-28 +- Rebuilt for removed libstdc++ symbol (#1937698) + +* Wed Jan 27 2021 Fedora Release Engineering - 1.11.1-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jan 22 2021 Jonathan Wakely - 1.11.1-26 +- Rebuilt for Boost 1.75 + +* Fri Jan 01 2021 Richard Shaw - 1.11.1-25 +- Rebuild for OpenEXR 2.5.3. + +* Wed Jul 29 2020 Fedora Release Engineering - 1.11.1-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 24 2020 Bruno Postle - 1.11.1-23 +- Rebuild for changed cmake macros + +* Thu Jun 25 2020 Orion Poplawski - 1.11.1-22 +- Rebuild for hdf5 1.10.6 + +* Thu May 28 2020 Jonathan Wakely - 1.11.1-21 +- Rebuilt for Boost 1.73 + +* Tue May 26 2020 Miro Hrončok - 1.11.1-20 +- Rebuilt for Python 3.9 + +* Fri Jan 31 2020 Fedora Release Engineering - 1.11.1-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Oct 03 2019 Miro Hrončok - 1.11.1-18 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Mon Aug 19 2019 Miro Hrončok - 1.11.1-17 +- Rebuilt for Python 3.8 + * Sat Jul 27 2019 Fedora Release Engineering - 1.11.1-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild