diff --git a/.github/workflows/test_napari_repo.yml b/.github/workflows/test_napari_repo.yml index 9f70aa522..ebf4af981 100644 --- a/.github/workflows/test_napari_repo.yml +++ b/.github/workflows/test_napari_repo.yml @@ -5,6 +5,11 @@ on: - cron: '0 10 * * 1,3,5' # every 24 hours # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + pull_request: + paths: + - '.github/workflows/test_napari_repo.yml' + - pyproject.toml + - tox.ini jobs: download_data: @@ -29,7 +34,7 @@ jobs: fail-fast: false matrix: platform: [ ubuntu-22.04 ] - python: ['3.8', '3.9' , '3.10', '3.11'] + python: ['3.9' , '3.10', '3.11', '3.12'] napari_version: ['repo'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test_napari_widgets.yml b/.github/workflows/test_napari_widgets.yml index 2194828f0..c17390a5b 100644 --- a/.github/workflows/test_napari_widgets.yml +++ b/.github/workflows/test_napari_widgets.yml @@ -27,7 +27,7 @@ jobs: with: python_version: "3.10" os: ${{ matrix.os }} - napari: "napari419" + napari: "napari5" qt_backend: ${{ matrix.qt_backend }} timeout: 10 diff --git a/package/PartSeg/common_gui/colormap_creator.py b/package/PartSeg/common_gui/colormap_creator.py index acd03206e..9a5687f35 100644 --- a/package/PartSeg/common_gui/colormap_creator.py +++ b/package/PartSeg/common_gui/colormap_creator.py @@ -381,7 +381,8 @@ class for preview single colormap. Witch checkbox for change selection. selection_changed = Signal(str, bool) """checkbox selection changed (name)""" - edit_request = Signal([str], [Colormap]) + edit_request_name = Signal(str) + edit_request_colormap = Signal(Colormap) """send after pressing edit signal (name) (ColorMap object)""" remove_request = Signal(str) """Signal with name of colormap (name)""" @@ -419,9 +420,9 @@ def __init__( layout.addWidget(self.label) self.setLayout(layout) self.checked.stateChanged.connect(self._selection_changed) - self.edit_btn.clicked.connect(partial(self.edit_request.emit, name)) + self.edit_btn.clicked.connect(partial(self.edit_request_name.emit, name)) if len(colormap.controls) < 20: - self.edit_btn.clicked.connect(partial(self.edit_request[Colormap].emit, colormap)) + self.edit_btn.clicked.connect(partial(self.edit_request_colormap.emit, colormap)) self.edit_btn.setToolTip("Create colormap base on this") else: self.edit_btn.setDisabled(True) @@ -547,7 +548,7 @@ def refresh(self): cache_dict[el.name] = el else: el.deleteLater() - el.edit_request[Colormap].disconnect() + el.edit_request_colormap.disconnect() el.remove_request.disconnect() el.selection_changed.disconnect() selected = self.get_selected() @@ -560,7 +561,7 @@ def refresh(self): widget.set_chosen(name in selected) else: widget = self._create_colormap_preview(colormap, name, removable) - widget.edit_request[Colormap].connect(self.edit_signal) + widget.edit_request_colormap.connect(self.edit_signal) widget.remove_request.connect(self._remove_request) widget.selection_changed.connect(self.change_selection) layout.addWidget(widget, i // columns, i % columns) diff --git a/package/tests/conftest.py b/package/tests/conftest.py index be5179241..b70562e34 100644 --- a/package/tests/conftest.py +++ b/package/tests/conftest.py @@ -279,7 +279,7 @@ def pytest_collection_modifyitems(session, config, items): items[:] = image_tests + core_tests + other_test -def pytest_runtest_setup(item): +def pytest_runtest_setup(item): # pragma: no cover if platform.system() == "Windows" and any(item.iter_markers(name="windows_ci_skip")): pytest.skip("glBindFramebuffer with no OpenGL") if platform.system() == "Windows" and any(item.iter_markers(name="pyside_skip")): @@ -287,3 +287,8 @@ def pytest_runtest_setup(item): if qtpy.API_NAME == "PySide2": pytest.skip("PySide2 problems") + if any(item.iter_markers(name="pyside6_skip")): + import qtpy + + if qtpy.API_NAME == "PySide6": + pytest.skip("PySide6 problems") diff --git a/package/tests/test_PartSeg/test_base_widgets.py b/package/tests/test_PartSeg/test_base_widgets.py index 2e57cf57f..8fc1c1d44 100644 --- a/package/tests/test_PartSeg/test_base_widgets.py +++ b/package/tests/test_PartSeg/test_base_widgets.py @@ -106,6 +106,7 @@ def test_napari_viewer_additional_layers_empty(self, qtbot, part_settings, monke information_mock.assert_called_once() @pytest.mark.windows_ci_skip() + @pytest.mark.pyside6_skip() def test_napari_viewer_additional_layers(self, qtbot, part_settings, monkeypatch): main_window = BaseMainWindow(settings=part_settings) qtbot.addWidget(main_window) diff --git a/pyproject.toml b/pyproject.toml index dd50dd1a1..ae9d0f516 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -205,7 +205,8 @@ markers = [ "enabledialog: Allow to use dialog in test", "no_patch_add_layer: Do not patch napari viewer", "windows_ci_skip: Skip test when running on windows CI", - "pyside_skip: Skip test when using pyside qt backend", + "pyside_skip: Skip test when using pyside2 qt backend", + "pyside6_skip: Skip test when using pyside6 qt backend" ] [tool.coverage.paths] diff --git a/tox.ini b/tox.ini index 53768ef3e..5d0a69ba5 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py{38,39,310,311,312}-{PyQt5,PySide2,PyQt6,PySide6}-all, py{38,39,310,311,312}-{PyQt5,PySide2,PyQt6,PySide6}-napari_{417,418,419,repo} +envlist = py{38,39,310,311,312}-{PyQt5,PySide2,PyQt6,PySide6}-all, py{39,310,311,312}-{PyQt5,PyQt6}-napari_{417,418,419,5,repo}, py{39,310}-PySide2-napari_{417,418,419,5,repo} toxworkdir=/tmp/tox [gh-actions] @@ -22,6 +22,7 @@ NAPARI = napari417: napari_417 napari418: napari_418 napari419: napari_419 + napari5: napari_5 repo: napari_repo BACKEND = pyqt: PyQt5 @@ -39,7 +40,8 @@ deps = PySide2: PySide2!=5.15.0 PyQt6: PyQt6 # fix PySide6 when a new napari release is out - PySide6: PySide6<6.3.2 + PySide6: PySide6<6.3.2; python_version < "3.10" + PySide6: PySide6; python_version >= "3.10" PySide2: npe2!=0.2.2 imageio != 2.22.1 pytest-json-report @@ -71,18 +73,20 @@ deps= pytest-json-report lxml_html_clean -[testenv:py{38,39,310,311,312}-{PyQt5,PySide2,PyQt6,PySide6}-napari_{417,418,419,repo}] +[testenv:py{38,39,310,311,312}-{PyQt5,PySide2,PyQt6,PySide6}-napari_{417,418,419,5,repo}] deps = {[testenv]deps} - 417: napari==0.4.17 - 417: pydantic<2 - 418: napari==0.4.18 - 418: pydantic<2 - 419: napari==0.4.19.post1 - repo: git+https://github.com/napari/napari.git + napari_417: napari==0.4.17 + napari_417: pydantic<2 + napari_418: napari==0.4.18 + napari_418: pydantic<2 + napari_419: napari==0.4.19.post1 + napari_5: napari==0.5.0 + napari_repo: git+https://github.com/napari/napari.git + numpy<2 commands = - !repo: python -m pytest -v package/tests/test_PartSeg/test_napari_widgets.py --json-report --json-report-file={toxinidir}/report-{envname}-{sys_platform}.json - repo: python -m pytest --json-report --json-report-file={toxinidir}/report-{envname}-{sys_platform}.json + !napari_repo: python -m pytest -v package/tests/test_PartSeg/test_napari_widgets.py --json-report --json-report-file={toxinidir}/report-{envname}-{sys_platform}.json + napari_repo: python -m pytest package/tests --json-report --json-report-file={toxinidir}/report-{envname}-{sys_platform}.json [testenv:py{38,39,310,311,312}-PyQt5-coverage] deps =