diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b43789d..cea2d62 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,8 +1,8 @@ {% set name = "lal" %} -{% set version = "7.6.0" %} +{% set version = "7.6.1" %} # define build number -{% set build = 3 %} +{% set build = 0 %} # default FFT implememntation to FFTW {% if fft_impl is not defined %} @@ -18,8 +18,8 @@ {% set swig_version = "3.0.10" %} # avoid circular imports that would break migrations -{% set migrating = False %} -{% set migrating = True %} # [python_impl!='cpython' or py>=313] +{% set migrating = false %} +{% set migrating = true %} # [python_impl!='cpython' or py>=313] package: name: {{ name }}-split @@ -27,7 +27,7 @@ package: source: url: https://software.igwn.org/sources/source/lalsuite/{{ name }}-{{ version }}.tar.xz - sha256: c173ff3112065706dc0ad1cc5062b32ae72a25de1a079bad9d198f657b82e463 + sha256: 56eacde7a803f341011d5953dd3ca5da0de0d58b0a34ee07fdb0900662bcf3bf patches: # to update the patches for a new release: # @@ -49,10 +49,6 @@ source: # see https://git.ligo.org/lscsoft/lalsuite/-/issues/300 - patches/0001-lal-use-RTLD_DEEPBIND-when-importing-the-LAL-SWIG-li.patch # [linux] - # backport https://git.ligo.org/lscsoft/lalsuite/-/merge_requests/2364 - - patches/0002-common-swig-generate_swig_iface.py-prefer-stringval-.patch - - patches/0003-lal-swig-SWIGCommon.i-refactor-SWIGLAL_MAYBE_RETURN_.patch - - patches/0004-lal-swig-SWIGTestLALPython.py-use-catch_errors-wrapp.patch build: diff --git a/recipe/patches/0002-common-swig-generate_swig_iface.py-prefer-stringval-.patch b/recipe/patches/0002-common-swig-generate_swig_iface.py-prefer-stringval-.patch deleted file mode 100644 index 28e209c..0000000 --- a/recipe/patches/0002-common-swig-generate_swig_iface.py-prefer-stringval-.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 66b74df539e7e1b66b830c13e2000feadd20018c Mon Sep 17 00:00:00 2001 -From: Karl Wette -Date: Thu, 24 Oct 2024 18:06:30 +1100 -Subject: [PATCH 2/4] common/swig/generate_swig_iface.py: prefer "stringval" - before "value" attribute - -- As of SWIG 4.3.0 "value" attribute contains quote characters -- "stringval" attribute appears to still contain the raw string - -(cherry picked from commit 9dba245ab3692ecf691247a442704f13c075ed34) ---- - common/swig/generate_swig_iface.py | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/lal/swig/generate_swig_iface.py b/lal/swig/generate_swig_iface.py -index 530b026d5d..eaee2d41ce 100644 ---- a/lal/swig/generate_swig_iface.py -+++ b/lal/swig/generate_swig_iface.py -@@ -195,9 +195,11 @@ class SwigSymbols(object): - """Parse a swiglal macro - """ - cdecl_name = get_swig_attr(cdecl, 'name') -- cdecl_value = get_swig_attr(cdecl, 'value') -+ cdecl_value = get_swig_attr(cdecl, 'stringval') - if not cdecl_value: -- raise ValueError("cdecl '{}' has no value".format(cdecl_name)) -+ cdecl_value = get_swig_attr(cdecl, 'value') -+ if not cdecl_value: -+ raise ValueError("cdecl '{}' has no value".format(cdecl_name)) - macro = re.sub(r'\s', '', cdecl_value) - if cdecl_name == '__swiglal__': - if macro in clear_macros: --- -2.39.5 - diff --git a/recipe/patches/0003-lal-swig-SWIGCommon.i-refactor-SWIGLAL_MAYBE_RETURN_.patch b/recipe/patches/0003-lal-swig-SWIGCommon.i-refactor-SWIGLAL_MAYBE_RETURN_.patch deleted file mode 100644 index 48b681b..0000000 --- a/recipe/patches/0003-lal-swig-SWIGCommon.i-refactor-SWIGLAL_MAYBE_RETURN_.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 8e828969badeaa98af961d6fe8f8b8fdb09289a5 Mon Sep 17 00:00:00 2001 -From: Karl Wette -Date: Thu, 24 Oct 2024 21:37:48 +1100 -Subject: [PATCH 3/4] lal/swig/SWIGCommon.i: refactor SWIGLAL_MAYBE_RETURN_INT - typemap - -- New behaviour of SWIG_Python_AppendOutput() makes it more difficult - to not add XLAL error code at start of output argument list -- Instead, always add XLAL error code at start of output argument list, - them remove it later in "newfree" typemap - -(cherry picked from commit e12d57e893882c1603778018139ed9060579c8a7) ---- - lal/swig/SWIGCommon.i | 23 +++++------------------ - lal/swig/SWIGOctave.i | 6 ++++-- - lal/swig/SWIGPython.i | 16 +++++++++++++--- - 3 files changed, 22 insertions(+), 23 deletions(-) - -diff --git a/lal/swig/SWIGCommon.i b/lal/swig/SWIGCommon.i -index bb6dc62e6e..3ce595e232 100644 ---- a/lal/swig/SWIGCommon.i -+++ b/lal/swig/SWIGCommon.i -@@ -1650,24 +1650,11 @@ if (strides[I-1] == 0) { - /// ignored in the wrappings. Functions which fit this criteria but do return a useful int can - /// use SWIGLAL(RETURN_VALUE(int, ...)) to disable this behaviour. - /// --/// For functions, since %feature("new") is set, the out typemap will have $owner=1, --/// and the newfree typemap is also applied. The out typemap ignores the int return value --/// by setting the output argument list to VOID_Object; the wrapping function them proceeds to --/// add other output arguments to the list, if any. After this, the newfree typemap is triggered, --/// which appends the int return if the output argument list is empty, using the --/// scripting-language-specific macro \b swiglal_append_output_if_empty(). For structs, --/// $owner=0, so the int return is set straight away, and the newfree typemap is never --/// applied. --/// --%typemap(out, noblock=1, fragment=SWIG_From_frag(int)) int SWIGLAL_MAYBE_RETURN_INT { --%#if $owner -- %set_output(VOID_Object); --%#else -- %set_output(SWIG_From(int)($1)); --%#endif --} --%typemap(newfree, noblock=1, fragment=SWIG_From_frag(int)) int SWIGLAL_MAYBE_RETURN_INT { -- swiglal_append_output_if_empty(SWIG_From(int)($1)); -+/// For functions, the newfree typemap is applied, which calls the scripting-language-specific macro -+/// \b swiglal_maybe_return_int(). For structs, the newfree typemap is never applied. -+/// -+%typemap(newfree, noblock=1) int SWIGLAL_MAYBE_RETURN_INT { -+ swiglal_maybe_return_int(); - } - - /// -diff --git a/lal/swig/SWIGOctave.i b/lal/swig/SWIGOctave.i -index d2ef3cbdbc..8c0ea50da4 100644 ---- a/lal/swig/SWIGOctave.i -+++ b/lal/swig/SWIGOctave.i -@@ -65,9 +65,11 @@ extern "C++" { - #define swiglal_get_reference(v) (v) - %} - --// Append an argument to the output argument list of an Octave SWIG-wrapped function, if the list is empty. -+// Remove the first argument (i.e. the XLAL error code) from the output argument list of an -+// Octave SWIG-wrapped function, if the list has more than one output argument. - %header %{ --#define swiglal_append_output_if_empty(v) if (_outp->length() == 0) _outp = SWIG_Octave_AppendOutput(_outp, v) -+#define swiglal_maybe_return_int() \ -+ if (_out.length() > 1) _out = _out.slice(1, _out.length() - 1) - %} - - // Evaluates true if an octave_value represents a null pointer, false otherwise. -diff --git a/lal/swig/SWIGPython.i b/lal/swig/SWIGPython.i -index 2482a8580f..8f332822d1 100644 ---- a/lal/swig/SWIGPython.i -+++ b/lal/swig/SWIGPython.i -@@ -86,10 +86,20 @@ import_array(); - SWIGINTERNINLINE PyObject* swiglal_get_reference(PyObject* v) { Py_XINCREF(v); return v; } - %} - --// Append an argument to the output argument list of an Python SWIG-wrapped function, if the list is --// empty. -+// Remove the first argument (i.e. the XLAL error code) from the output argument list of a -+// Python SWIG-wrapped function, if the list has more than one output argument. - %header %{ --#define swiglal_append_output_if_empty(v) if (resultobj == Py_None) resultobj = SWIG_Python_AppendOutput(resultobj, v) -+SWIGINTERN PyObject* swiglal_py_remove_first_output(PyObject *result) { -+ PySequence_DelItem(result, 0); -+ if (PySequence_Size(result) == 1) { -+ PyObject *obj = result; -+ result = PySequence_GetItem(obj, 0); -+ Py_DECREF(obj); -+ } -+ return result; -+} -+#define swiglal_maybe_return_int() \ -+ if (PySequence_Check(resultobj) && PySequence_Size(resultobj) > 1) resultobj = swiglal_py_remove_first_output(resultobj) - %} - - // Evaluates true if a PyObject represents a null pointer, false otherwise. --- -2.39.5 - diff --git a/recipe/patches/0004-lal-swig-SWIGTestLALPython.py-use-catch_errors-wrapp.patch b/recipe/patches/0004-lal-swig-SWIGTestLALPython.py-use-catch_errors-wrapp.patch deleted file mode 100644 index 840a0f4..0000000 --- a/recipe/patches/0004-lal-swig-SWIGTestLALPython.py-use-catch_errors-wrapp.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 0be8923c7b2dc5aa8abccb52103c58fa960e2ec5 Mon Sep 17 00:00:00 2001 -From: Karl Wette -Date: Fri, 25 Oct 2024 16:29:05 +1100 -Subject: [PATCH 4/4] lal/swig/SWIGTestLALPython.py: use catch_errors() wrapper - around pytest.raises() - -(cherry picked from commit 329b90c74246887ae0f1855e707104ef296a549b) ---- - lal/swig/SWIGTestLALPython.py | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/lal/swig/SWIGTestLALPython.py b/lal/swig/SWIGTestLALPython.py -index a2e7b54689..293571ea0f 100644 ---- a/lal/swig/SWIGTestLALPython.py -+++ b/lal/swig/SWIGTestLALPython.py -@@ -383,7 +383,7 @@ def test_fixed_and_dynamic_arrays_typemaps(): - lal.swig_lal_test_copyin_array1( - numpy.array([0, 0, 0, 0], dtype=numpy.double), 0 - ) -- with pytest.raises(TypeError): -+ with catch_errors(TypeError): - lal.swig_lal_test_copyin_array2( - numpy.array([[1.2, 3.4], [0, 0], [0, 0]], dtype=numpy.double), 0 - ) -@@ -1318,9 +1318,9 @@ def test_LIGOTimeGPS_operations(): - "*** below should be error messages from LIGOTimeGPS constructor ***", - file=sys.stderr, - ) -- with pytest.raises(RuntimeError): -+ with catch_errors(RuntimeError): - t5 = LIGOTimeGPS("abc1000") -- with pytest.raises(RuntimeError): -+ with catch_errors(RuntimeError): - t5 = LIGOTimeGPS("1000abc") - print( - "*** above should be error messages from LIGOTimeGPS constructor ***", -@@ -1333,7 +1333,7 @@ def test_LIGOTimeGPS_operations(): - "*** below should be error messages from LIGOTimeGPS constructor ***", - file=sys.stderr, - ) -- with pytest.raises(RuntimeError): -+ with catch_errors(RuntimeError): - LIGOTimeGPS(None) - print( - "*** above should be error messages from LIGOTimeGPS constructor ***", -@@ -1385,7 +1385,7 @@ def test_LALUnit_operations(): - u2 = lal.MeterUnit ** (1, 2) * lal.KiloGramUnit ** (1, 2) * lal.SecondUnit**-1 - assert is_value_and_type(u2, u1 ** (1, 2), lal.Unit) - set_nice_error_handlers() -- with pytest.raises((RuntimeError, TypeError)): -+ with catch_errors((RuntimeError, TypeError)): - lal.SecondUnit ** (1, 0) - u1 *= lal.MeterUnit - assert is_value_and_type(u1, lal.JouleUnit, lal.Unit) -@@ -1401,7 +1401,7 @@ def test_LALUnit_operations(): - assert int(u1) == 1000 - u1 /= 10000 - assert u1 == 100 * lal.MilliUnit * lal.WattUnit -- with pytest.raises( -+ with catch_errors( - ( - ValueError, # swig < 4.0.0 - TypeError, # swig >= 4.0.0 -@@ -1422,7 +1422,7 @@ def test_Python_non_dynamic_structs(): - sts.n = 1 - sts.Alpha = 1.234 - set_nice_error_handlers() -- with pytest.raises(AttributeError): -+ with catch_errors(AttributeError): - sts.N = 1 - sts.alpha = 1.234 - sts.zzzzz = "does not exist" --- -2.39.5 -