Package: src:napari
Version: 0.8.0~a3-1
User: [email protected]
Usertags: python3.15
Tags: ftbfs, forky, sid
Severity: important

Hi!

While rebuilding the python related packages against the Python 3.15rc2 version we found that napari fails to build from source:
https://debusine.debian.net/debian/r-python-python3.15/artifact/4855567/

From the log, the error seems to be:

=================================== FAILURES =================================== _______________________ test_selection_collision[random] _______________________

qt_viewer = <napari._qt.qt_viewer.QtViewer object at 0x7f06e7c29ef0>
viewer_model = ViewerModel(mouse_move_callbacks=[], mouse_wheel_callbacks=[<function dims_scroll at 0x7f079fc22da0>, <function layers...k mode', status='Ready', tooltip=Tooltip(visible=False, text=''), theme='dark', title='napari', mouse_over_canvas=True)
mode = 'random'

    @pytest.mark.slow
    @pytest.mark.show_qt_viewer
    @pytest.mark.parametrize('mode', ['direct', 'random'])
    def test_selection_collision(
        qt_viewer: QtViewer,
        viewer_model: ViewerModel,
        mode: typing.Literal['direct', 'random'],
    ) -> None:
        data = np.zeros((10, 10), dtype=np.uint8)
        data[:5] = 10
        data[5:] = 10 + 49
        layer = viewer_model.add_labels(data, opacity=1)
        layer.selected_label = 10
        if mode == 'direct':
            layer.colormap = DirectLabelColormap(
                color_dict={10: 'red', 10 + 49: 'red', None: 'black'}
            )

        for dtype in NUMPY_INTEGER_TYPES:
            layer.data = data.astype(dtype)
            layer.show_selected_label = False
            QApplication.processEvents()
            canvas_screenshot = qt_viewer.screenshot(flash=False)
            shape = np.array(canvas_screenshot.shape[:2])
pixel_10 = canvas_screenshot[tuple((shape * 0.25).astype(int))] pixel_59 = canvas_screenshot[tuple((shape * 0.75).astype(int))] npt.assert_array_equal(pixel_10, pixel_59, err_msg=f'{dtype}')
          assert not np.all(pixel_10 == [0, 0, 0, 255]), dtype
E           AssertionError: <class 'numpy.int8'>
E           assert not np.True_
E + where np.True_ = <function all at 0x7f07a82a25f0>(array([ 0, 0, 0, 255], dtype=uint8) == [0, 0, 0, 255]
E            +    where <function all at 0x7f07a82a25f0> = np.all
E
E               Full diff:
E               + array([  0,   0,   0, 255], dtype=uint8)
E               - [
E               -     0,
E               -     0,
E               -     0,
E               -     255,
E               - ])

napari/_qt/_tests/test_qt_viewer.py:1039: AssertionError

Please note that while we ran into this error during the rebuild against Python 3.15, that doesn't mean that the root cause for the failure is necessarily the new Python version, but in this case it seems quite likely, as the same test succeeds on Python 3.14 and fails on Python 3.15.

In order to build against the test archive, which includes not only python3.15 but also all the relevant build-dependencies rebuilt against it, you can add the test repository:

deb http://deb.debusine.debian.net/debian/r-python-python3.15 sid-python3.15 main

The corresponding signing key can be seen in the first section of https://deb.debusine.debian.net/debian/r-python-python3.15/

To build from a git repository, you can use something like:
gbp buildpackage --no-clean-source --git-builder='sbuild --no-run-lintian --extra-repository="deb http://deb.debusine.debian.net/debian/r-python-python3.15 sid-python3.15 main" --extra-repository-key="/path/to/signing-keys.asc"'

Setting the severity to important for now. Once Python 3.15 is released and later added to python3-defaults, this bug will become release critical.

--
Regards,
Marga

Reply via email to