[Debian-astro-maintainers] Bug#1055877: ndcube: FTBFS in bookworm: leap-second file is expired
Santiago Vila
sanvila at debian.org
Mon Nov 13 12:23:21 GMT 2023
Package: src:ndcube
Version: 2.0.3-1
Severity: serious
Tags: ftbfs bookworm patch upstream
Dear maintainer:
During a rebuild of all packages in bookworm, this package failed to build
with the following error:
---------------------------------------------------------------------------
files = None
def update_leap_seconds(files=None):
"""If the current ERFA leap second table is out of date, try to update it.
Uses `astropy.utils.iers.LeapSeconds.auto_open` to try to find an
up-to-date table. See that routine for the definition of "out of date".
In order to make it safe to call this any time, all exceptions are turned
into warnings,
Parameters
----------
files : list of path-like, optional
List of files/URLs to attempt to open. By default, uses defined by
`astropy.utils.iers.LeapSeconds.auto_open`, which includes the table
used by ERFA itself, so if that is up to date, nothing will happen.
Returns
-------
n_update : int
Number of items updated.
"""
try:
from astropy.utils import iers
table = iers.LeapSeconds.auto_open(files)
return erfa.leap_seconds.update(table)
except Exception as exc:
> warn(
f"leap-second auto-update failed due to the following exception: {exc!r}",
AstropyWarning,
)
E astropy.utils.exceptions.AstropyWarning: leap-second auto-update failed due to the following exception: IERSStaleWarning('leap-second file is expired.')
/usr/lib/python3/dist-packages/astropy/time/core.py:3315: AstropyWarning
=========================== short test summary info ============================
FAILED ../../../ndcube/extra_coords/tests/test_extra_coords.py::test_two_1d_from_lut
= 1 failed, 276 passed, 5 skipped, 27 deselected, 9 xfailed, 2 xpassed in 4.68s =
E: pybuild pybuild:388: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ndcube/build; python3.11 -m pytest ../../../ndcube
dh_auto_test: error: pybuild --test -i python{version} -p 3.11 returned exit code 13
make: *** [debian/rules:14: binary-indep] Error 25
dpkg-buildpackage: error: debian/rules binary-indep subprocess returned exit status 2
In reproducible-builds, the same package version (2.0.3-1) builds ok in trixie:
https://tests.reproducible-builds.org/debian/rbuild/trixie/amd64/ndcube_2.0.3-1.rbuild.log.gz
but not the second build, which is tried one month in the future precisely
to catch errors like this one:
https://tests.reproducible-builds.org/debian/logs/trixie/amd64/ndcube_2.0.3-1.build2.log.gz
Note that because exactly the same package version builds ok in trixie but not in bookworm, we could be tempted to consider this as a bug in the package which provides the leap-second file, which is "not updated enough in bookworm".
However, I don't think this would be a good idea, as this problem would become some sort
of time-bomb. We want packages to build ok from source not only at release time but also
during all the lifetime of bookworm as stable (and if possible, forever), i.e. users should
not be forced to upgrade all the time so that the packages continue to build ok.
I attach a patch which works for me in bookworm. Please double-check, no warranty, etc.
Alternatively, all those unconditional skip marks could be
changed to something like this, in pseudocode:
skipif(currentdate > hardcoded-expiration-date-of-leapsecond-file-at-upload-time)
but I don't really know if it worth the effort.
I'm tagging this as "upstream" because I believe there should be an easier way
to deal with this.
Thanks.
-------------- next part --------------
commit 079219c8ad4bc798065a28528283f59373be2623
Author: Santiago Vila <sanvila at debian.org>
Date: Mon Nov 13 13:15:00 2023 +0100
skip-time-bombs
diff --git a/ndcube/extra_coords/tests/test_extra_coords.py b/ndcube/extra_coords/tests/test_extra_coords.py
index f3463b2..197b934 100644
--- a/ndcube/extra_coords/tests/test_extra_coords.py
+++ b/ndcube/extra_coords/tests/test_extra_coords.py
@@ -158,6 +158,7 @@ def test_single_from_lut(extra_coords_wave):
assert ec.wcs.world_axis_names == ("wave",)
+ at pytest.mark.skip(reason="time bomb")
def test_two_1d_from_lut(time_lut):
cube = MagicMock()
cube.dimensions = [10] * u.pix
@@ -174,6 +175,7 @@ def test_two_1d_from_lut(time_lut):
assert ec.wcs.world_axis_names == ("time", "exposure_time")
+ at pytest.mark.skip(reason="time bomb")
def test_two_1d_from_lookup_tables(time_lut):
"""
Create ExtraCoords from both tables at once using `from_lookup_tables` with `physical_types`.
@@ -252,6 +254,7 @@ def test_skycoord_mesh_false(skycoord_2d_lut):
assert ec.wcs.world_axis_names == ("lat", "lon")
+ at pytest.mark.skip(reason="time bomb")
def test_extra_coords_index(skycoord_2d_lut, time_lut):
cube = MagicMock()
cube.dimensions = [10, 10] * u.pix
@@ -300,6 +303,8 @@ def test_extra_coords_2d_quantity(quantity_2d_lut):
# Extra Coords with NDCube
+
+ at pytest.mark.skip(reason="time bomb")
def test_add_coord_after_create(time_lut):
ndc = NDCube(np.random.random((10, 10)), wcs=WCS(naxis=2))
assert isinstance(ndc.extra_coords, ExtraCoords)
@@ -310,6 +315,7 @@ def test_add_coord_after_create(time_lut):
assert ndc.extra_coords["time"]._lookup_tables == ndc.extra_coords._lookup_tables
+ at pytest.mark.skip(reason="time bomb")
def test_combined_wcs(time_lut):
ndc = NDCube(np.random.random((10, 10)), wcs=WCS(naxis=2))
assert isinstance(ndc.extra_coords, ExtraCoords)
@@ -323,6 +329,7 @@ def test_combined_wcs(time_lut):
assert world[2] == Time("2011-01-01T00:00:00")
+ at pytest.mark.skip(reason="time bomb")
def test_slice_extra_1d(time_lut, wave_lut):
ec = ExtraCoords()
ec.add("time", 0, time_lut)
@@ -337,6 +344,7 @@ def test_slice_extra_1d(time_lut, wave_lut):
ec['time'].wcs.pixel_to_world_values(list(range(4))))
+ at pytest.mark.skip(reason="time bomb")
def test_slice_extra_2d(time_lut, skycoord_2d_lut):
ec = ExtraCoords()
ec.add(("lat", "lon"), (0, 1), skycoord_2d_lut, mesh=False)
@@ -354,6 +362,7 @@ def test_slice_extra_2d(time_lut, skycoord_2d_lut):
ec['exposure_time'].wcs.pixel_to_world_values(list(range(1, 4))))
+ at pytest.mark.skip(reason="time bomb")
def test_slice_drop_dimensions(time_lut, skycoord_2d_lut):
ec = ExtraCoords()
ec.add(("lat", "lon"), (0, 1), skycoord_2d_lut, mesh=False)
@@ -379,6 +388,7 @@ def test_slice_drop_dimensions(time_lut, skycoord_2d_lut):
ec['exposure_time'].wcs.pixel_to_world_values(list(range(2)), list(range(2))))
+ at pytest.mark.skip(reason="time bomb")
def test_slice_extra_twice(time_lut, wave_lut):
ec = ExtraCoords()
ec.add("time", 0, time_lut)
@@ -397,6 +407,7 @@ def test_slice_extra_twice(time_lut, wave_lut):
ec['time'].wcs.pixel_to_world_values(list(range(2, 4))))
+ at pytest.mark.skip(reason="time bomb")
def test_slice_extra_1d_drop(time_lut, wave_lut):
ec = ExtraCoords()
ec.add("time", 0, time_lut)
@@ -414,6 +425,7 @@ def test_slice_extra_1d_drop(time_lut, wave_lut):
assert dwd["world_axis_units"] == ["nm"]
+ at pytest.mark.skip(reason="time bomb")
def test_slice_extra_1d_drop_alter_mapping_tuple_item(time_lut, wave_lut):
ec = ExtraCoords()
ec.add("time", 0, time_lut)
@@ -431,6 +443,7 @@ def test_slice_extra_1d_drop_alter_mapping_tuple_item(time_lut, wave_lut):
assert dwd["world_axis_units"] == ["s"]
+ at pytest.mark.skip(reason="time bomb")
def test_slice_extra_1d_drop_alter_mapping_int_item(time_lut, wave_lut):
ec = ExtraCoords()
ec.add("time", 0, time_lut)
@@ -448,6 +461,7 @@ def test_slice_extra_1d_drop_alter_mapping_int_item(time_lut, wave_lut):
assert dwd["world_axis_units"] == ["s"]
+ at pytest.mark.skip(reason="time bomb")
def test_dropped_dimension_reordering():
data = np.ones((3, 4, 5))
wcs_input_dict = {
diff --git a/ndcube/extra_coords/tests/test_lookup_table_coord.py b/ndcube/extra_coords/tests/test_lookup_table_coord.py
index e2f87d3..e4b25bd 100644
--- a/ndcube/extra_coords/tests/test_lookup_table_coord.py
+++ b/ndcube/extra_coords/tests/test_lookup_table_coord.py
@@ -220,6 +220,7 @@ def test_2d_skycoord_no_mesh(lut_2d_skycoord_no_mesh):
assert u.allclose(pix, pixel_coords.value)
+ at pytest.mark.skip(reason="time bomb")
def test_1d_time(lut_1d_time):
assert lut_1d_time.model.n_inputs == 1
assert lut_1d_time.model.n_outputs == 1
@@ -229,6 +230,7 @@ def test_1d_time(lut_1d_time):
assert lut_1d_time.wcs.world_to_pixel(Time("2011-01-01T00:00:00")) == 0
+ at pytest.mark.skip(reason="time bomb")
def test_join(lut_1d_time, lut_1d_wave):
ltc = lut_1d_time & lut_1d_wave
@@ -461,6 +463,7 @@ def test_slicing_errors(lut_1d_time, lut_1d_wave, lut_1d_distance, lut_2d_skycoo
assert "length of the slice" in str(ei)
+ at pytest.mark.skip(reason="time bomb")
def test_mtc_dropped_table(lut_1d_time):
mtc = MultipleTableCoordinate(lut_1d_time)
sub = mtc[0]
@@ -482,6 +485,7 @@ def test_mtc_dropped_table(lut_1d_time):
assert dwd["value"] == [0*u.s]
+ at pytest.mark.skip(reason="time bomb")
def test_mtc_dropped_table_join(lut_1d_time, lut_2d_skycoord_mesh):
mtc = MultipleTableCoordinate(lut_1d_time, lut_2d_skycoord_mesh)
sub = mtc[0, :, :]
@@ -597,6 +601,7 @@ def test_mtc_dropped_quantity_inside_table_no_mesh(lut_2d_distance_no_mesh):
assert not dwd
+ at pytest.mark.skip(reason="time bomb")
def test_mtc_dropped_quantity_join_drop_table(lut_1d_time, lut_3d_distance_mesh):
mtc = MultipleTableCoordinate(lut_1d_time, lut_3d_distance_mesh)
sub = mtc[:, 0, :, :]
diff --git a/ndcube/tests/test_ndcube.py b/ndcube/tests/test_ndcube.py
index 64b30c1..cf3548e 100644
--- a/ndcube/tests/test_ndcube.py
+++ b/ndcube/tests/test_ndcube.py
@@ -170,6 +170,7 @@ def test_slicing_removed_world_coords(ndcube_3d_ln_lt_l):
assert all_coords[wl_key][0] == wl_key
+ at pytest.mark.skip(reason="time bomb")
def test_axis_world_coords_wave_ec(ndcube_3d_l_ln_lt_ectime):
cube = ndcube_3d_l_ln_lt_ectime
@@ -194,6 +195,7 @@ def test_axis_world_coords_wave_ec(ndcube_3d_l_ln_lt_ectime):
assert coords[0].shape == (5,)
+ at pytest.mark.skip(reason="time bomb")
def test_axis_world_coords_empty_ec(ndcube_3d_l_ln_lt_ectime):
cube = ndcube_3d_l_ln_lt_ectime
sub_cube = cube[:, 0]
@@ -275,6 +277,7 @@ def test_axis_world_coords_sliced_all_4d(ndc, item):
assert u.allclose(coords, expected)
+ at pytest.mark.skip(reason="time bomb")
def test_axis_world_coords_all_4d_split(ndcube_4d_ln_l_t_lt):
coords = ndcube_4d_ln_l_t_lt.axis_world_coords()
assert len(coords) == 3
@@ -295,6 +298,7 @@ def test_axis_world_coords_all_4d_split(ndcube_4d_ln_l_t_lt):
(0, 1),
(0, 1, 3)
))
+ at pytest.mark.skip(reason="time bomb")
def test_axis_world_coords_all_4d_split_sub(ndcube_4d_ln_l_t_lt, wapt):
coords = ndcube_4d_ln_l_t_lt.axis_world_coords(*wapt)
assert len(coords) == 2
@@ -399,6 +403,7 @@ def test_array_axis_physical_types(ndcube_3d_ln_lt_l):
assert all([physical_type in expected[i] for physical_type in output[i]])
+ at pytest.mark.skip(reason="time bomb")
def test_crop(ndcube_4d_ln_lt_l_t):
cube = ndcube_4d_ln_lt_l_t
intervals = cube.wcs.array_index_to_world([1, 2], [0, 1], [0, 1], [0, 2])
@@ -419,6 +424,7 @@ def test_crop_tuple_non_tuple_input(ndcube_2d_ln_lt):
helpers.assert_cubes_equal(cropped_by_tuples, cropped_by_coords)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_with_nones(ndcube_4d_ln_lt_l_t):
cube = ndcube_4d_ln_lt_l_t
lower_corner = [None] * 3
@@ -463,6 +469,7 @@ def test_crop_scalar_valuerror(ndcube_2d_ln_lt):
cube.crop(point)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_missing_dimensions(ndcube_4d_ln_lt_l_t):
"""Test bbox coordinates not being the same length as cube WCS"""
cube = ndcube_4d_ln_lt_l_t
@@ -473,6 +480,7 @@ def test_crop_missing_dimensions(ndcube_4d_ln_lt_l_t):
cube.crop(lower_corner, upper_corner)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_mismatch_class(ndcube_4d_ln_lt_l_t):
"""Test bbox coordinates not being the same length as cube WCS"""
cube = ndcube_4d_ln_lt_l_t
@@ -593,6 +601,7 @@ def test_crop_by_values_1d_dependent(ndcube_4d_ln_lt_l_t):
helpers.assert_cubes_equal(output, expected)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_by_extra_coords(ndcube_3d_ln_lt_l_ec_time):
cube = ndcube_3d_ln_lt_l_ec_time
lower_corner = (Time("2000-01-01T15:00:00", scale="utc", format="fits"), None)
@@ -602,6 +611,7 @@ def test_crop_by_extra_coords(ndcube_3d_ln_lt_l_ec_time):
helpers.assert_cubes_equal(output, expected)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_by_extra_coords_values(ndcube_3d_ln_lt_l_ec_time):
cube = ndcube_3d_ln_lt_l_ec_time
lower_corner = (3 * 60 * 60 * u.s, 0 * u.pix)
@@ -611,6 +621,7 @@ def test_crop_by_extra_coords_values(ndcube_3d_ln_lt_l_ec_time):
helpers.assert_cubes_equal(output, expected)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_by_extra_coords_all_axes_with_coord(ndcube_3d_ln_lt_l_ec_all_axes):
cube = ndcube_3d_ln_lt_l_ec_all_axes
interval0 = Time(["2000-01-01T15:00:00", "2000-01-01T20:00:00"], scale="utc", format="fits")
@@ -623,6 +634,7 @@ def test_crop_by_extra_coords_all_axes_with_coord(ndcube_3d_ln_lt_l_ec_all_axes)
helpers.assert_cubes_equal(output, expected)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_by_extra_coords_values_all_axes_with_coord(ndcube_3d_ln_lt_l_ec_all_axes):
cube = ndcube_3d_ln_lt_l_ec_all_axes
interval0 = [3 * 60 * 60, 8 * 60 * 60] * u.s
@@ -653,6 +665,7 @@ def test_crop_by_extra_coords_values_shared_axis(ndcube_3d_ln_lt_l_ec_sharing_ax
helpers.assert_cubes_equal(output, expected)
+ at pytest.mark.skip(reason="time bomb")
def test_crop_rotated_celestial(ndcube_4d_ln_lt_l_t):
# This is a regression test for a highly rotated image where all 4 corners
# of the spatial ROI have to be used.
@@ -698,6 +711,7 @@ def test_crop_rotated_celestial(ndcube_4d_ln_lt_l_t):
assert small.data.shape == (1652, 1652)
+ at pytest.mark.skip(reason="time bomb")
def test_initialize_from_ndcube(ndcube_3d_l_ln_lt_ectime):
cube = ndcube_3d_l_ln_lt_ectime
cube.global_coords.add('distance', 'pos.distance', 1 * u.m)
@@ -718,6 +732,7 @@ def test_initialize_from_ndcube(ndcube_3d_l_ln_lt_ectime):
assert ec is not ec3
+ at pytest.mark.skip(reason="time bomb")
def test_reproject_interpolation(ndcube_4d_ln_l_t_lt, wcs_4d_lt_t_l_ln):
target_wcs_header = wcs_4d_lt_t_l_ln.low_level_wcs.to_header()
target_wcs_header['CDELT3'] = 0.1 # original value = 0.2
@@ -737,6 +752,7 @@ def test_reproject_invalid_wcs(ndcube_4d_ln_l_t_lt, wcs_3d_lt_ln_l):
_ = ndcube_4d_ln_l_t_lt.reproject_to(wcs_3d_lt_ln_l, shape_out=shape_out)
+ at pytest.mark.skip(reason="time bomb")
def test_reproject_with_header(ndcube_4d_ln_l_t_lt, wcs_4d_lt_t_l_ln):
target_wcs_header = wcs_4d_lt_t_l_ln.low_level_wcs.to_header()
shape_out = (5, 20, 12, 8)
@@ -744,6 +760,7 @@ def test_reproject_with_header(ndcube_4d_ln_l_t_lt, wcs_4d_lt_t_l_ln):
_ = ndcube_4d_ln_l_t_lt.reproject_to(target_wcs_header, shape_out=shape_out)
+ at pytest.mark.skip(reason="time bomb")
def test_reproject_return_footprint(ndcube_4d_ln_l_t_lt, wcs_4d_lt_t_l_ln):
target_wcs_header = wcs_4d_lt_t_l_ln.low_level_wcs.to_header()
target_wcs_header['CDELT3'] = 0.1 # original value = 0.2
@@ -758,6 +775,7 @@ def test_reproject_return_footprint(ndcube_4d_ln_l_t_lt, wcs_4d_lt_t_l_ln):
assert footprint.shape == (5, 20, 12, 8)
+ at pytest.mark.skip(reason="time bomb")
def test_reproject_shape_out(ndcube_4d_ln_l_t_lt, wcs_4d_lt_t_l_ln):
# should raise an exception when neither shape_out is specified nor
# target_wcs has the pixel_shape or array_shape attribute
diff --git a/ndcube/tests/test_ndcubesequence.py b/ndcube/tests/test_ndcubesequence.py
index 2d90eb1..a67a4c2 100644
--- a/ndcube/tests/test_ndcubesequence.py
+++ b/ndcube/tests/test_ndcubesequence.py
@@ -160,6 +160,7 @@ def test_cube_like_dimensions_error(ndc):
@pytest.mark.parametrize("ndc", (("ndcubesequence_3c_l_ln_lt_cax1",)), indirect=("ndc",))
+ at pytest.mark.skip(reason="time bomb")
def test_common_axis_coords(ndc):
# Construct expected skycoord
common_coords = [cube.axis_world_coords('lon') for cube in ndc]
@@ -184,6 +185,7 @@ def test_common_axis_coords(ndc):
@pytest.mark.parametrize("ndc", (("ndcubesequence_3c_l_ln_lt_cax1",)), indirect=("ndc",))
+ at pytest.mark.skip(reason="time bomb")
def test_sequence_axis_coords(ndc):
expected = {'distance': [1*u.m, 2*u.m, 3*u.m]}
output = ndc.sequence_axis_coords
More information about the Debian-astro-maintainers
mailing list