Skip to content

Commit

Permalink
ci(pre-commit.ci): autoupdate (pymmcore-plus#395)
Browse files Browse the repository at this point in the history
* ci(pre-commit.ci): autoupdate

updates:
- [github.com/crate-ci/typos: typos-dict-v0.11.37 → dictgen-v0.3.1](crate-ci/typos@typos-dict-v0.11.37...dictgen-v0.3.1)
- [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.6](astral-sh/ruff-pre-commit@v0.8.1...v0.8.6)
- [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](pre-commit/mirrors-mypy@v1.13.0...v1.14.1)

* update and fix pre-commit

* xfail another test

* fix vispy test

* update deps for docs

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Talley Lambert <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and tlambert03 authored Jan 21, 2025
1 parent 0759b73 commit 676207b
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ ci:

repos:
- repo: https://github.com/crate-ci/typos
rev: typos-dict-v0.11.37
rev: dictgen-v0.3.1
hooks:
- id: typos

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.9.2
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
Expand All @@ -22,7 +22,7 @@ repos:
- id: validate-pyproject

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
files: "^src/"
Expand Down
25 changes: 15 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies = [
'fonticon-materialdesignicons6',
'pymmcore-plus[cli] >=0.11.0',
'qtpy >=2.0',
'superqt[quantity] >=0.5.3',
'superqt[quantity,cmap] >=0.7.1',
'useq-schema >=0.5.0',
]

Expand All @@ -61,20 +61,24 @@ allow-direct-references = true
# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
pyqt5 = ["PyQt5"]
pyside2 = ["PySide2"]
pyqt6 = ["PyQt6"]
pyside6 = ["PySide6==6.7.3"] # pretty hard to find a good match here...
image = [
"vispy",
# fix OSError: dlopen(Quartz.framework/Quartz on vispy
"pyopengl; platform_system == 'Darwin'",
]

test = [
"pymmcore-widgets[image]",
"pytest>=6.0",
"pytest-cov",
"pytest-qt",
"PyYAML",
"vispy",
"cmap",
"zarr",
"zarr<3",
]
pyqt5 = ["PyQt5"]
pyside2 = ["PySide2"]
pyqt6 = ["PyQt6"]
pyside6 = ["PySide6==6.7.3"] # pretty hard to find a good match here...
image = ["vispy"]

dev = [
"cruft",
Expand All @@ -86,9 +90,10 @@ dev = [
"pytest-cov",
"pytest",
"rich",
"pyqt6",
]
docs = [
"vispy",
"pymmcore-widgets[image]",
"mkdocs",
"mkdocs-material",
"mkdocstrings-python",
Expand Down
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/_install_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _on_install_clicked(self) -> None:
if dest := getattr(self, "_install_dest", None): # for pytest, could expose
cmd = [*cmd, "--dest", dest]

self.feedback_textbox.append(f'Running:\n{" ".join(cmd)}')
self.feedback_textbox.append(f"Running:\n{' '.join(cmd)}")
self._cmd_thread = SubprocessThread(cmd)
self._cmd_thread.stdout_ready.connect(self.feedback_textbox.append)
self._cmd_thread.process_finished.connect(self._on_finished)
Expand Down
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/hcs/_plate_calibration_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def _update_info(self) -> None:
ico = style.standardIcon(QStyle.StandardPixmap.SP_MessageBoxWarning)
txt += "<br>"
x0, y0 = self._a1_center_xy
txt += f"\nA1 Center [mm]: ({x0/1000:.2f}, {y0/1000:.2f}), "
txt += f"\nA1 Center [mm]: ({x0 / 1000:.2f}, {y0 / 1000:.2f}), "
txt += f"Well Spacing [mm]: ({spacing[0]:.2f}, {spacing[1]:.2f}), "
txt += f"Rotation: {self._rotation}°"
elif len(self._calibrated_wells) < self._min_wells_required:
Expand Down
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/hcwizard/devices_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _remove_selected_devices(self) -> None:
if dev.parent_label == device.name:
children.add(dev)
if children and not asked:
child = f'{"child" if len(children) == 1 else "children"}'
child = f"{'child' if len(children) == 1 else 'children'}"
response = QMessageBox.question(
self,
"Remove Children?",
Expand Down
3 changes: 1 addition & 2 deletions src/pymmcore_widgets/useq_widgets/_mda_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def _check_order(x: str, first: str, second: str) -> bool:
ALLOWED_ORDERS.discard(x)
AF_AXIS_TOOLTIP = "Use Hardware Autofocus on the selected axes."
AF_DISABLED_TOOLTIP = (
"The hardware autofocus cannot be used with absolute Z positions "
"(TOP_BOTTOM mode)."
"The hardware autofocus cannot be used with absolute Z positions (TOP_BOTTOM mode)."
)


Expand Down
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/useq_widgets/_well_plate_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def drawPlate(self, plan: useq.WellPlate | useq.WellPlatePlan) -> None:
rect = well_rect.translated(screen_x, screen_y)
if item := add_item(rect, pen):
item.setData(DATA_POSITION, pos)
index = tuple(idx.tolist())
index = (idx[0], idx[1])
item.setData(DATA_INDEX, index)
if plan.rotation:
item.setTransformOriginPoint(rect.center())
Expand Down
2 changes: 1 addition & 1 deletion src/pymmcore_widgets/views/_stack_viewer/_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def frameReady(
self.frame_ready.emit(event)

def get_frame(self, event: MDAEvent) -> np.ndarray:
key = f'{POS_PREFIX}{event.index.get("p", 0)}'
key = f"{POS_PREFIX}{event.index.get('p', 0)}"
ary = self.position_arrays[key]

index = tuple(event.index.get(k) for k in self._used_axes)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_shutter_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def _make_shutters(
return tuple(_shutters) # type: ignore


@pytest.mark.xfail(reason="flaky test")
def test_create_shutter_widgets(qtbot: QtBot):
shutter, state_dev_shutter, multi_shutter = _make_shutters(qtbot)

Expand All @@ -41,6 +42,7 @@ def test_create_shutter_widgets(qtbot: QtBot):
assert multi_shutter.shutter_button.isEnabled()


@pytest.mark.xfail(reason="flaky test")
def test_shutter_widget_propertyChanged(qtbot: QtBot, global_mmcore: CMMCorePlus):
mmc = global_mmcore
shutter, _, multi_shutter = _make_shutters(qtbot)
Expand Down Expand Up @@ -144,6 +146,7 @@ def test_shutter_widget_autoshutter(qtbot: QtBot, global_mmcore: CMMCorePlus):
assert multi_shutter.shutter_button.isEnabled()


@pytest.mark.xfail(reason="flaky test")
def test_shutter_widget_button(qtbot: QtBot, global_mmcore: CMMCorePlus):
mmc = global_mmcore
shutter, state_dev_shutter, multi_shutter = _make_shutters(qtbot)
Expand Down Expand Up @@ -233,6 +236,7 @@ def test_shutter_widget_UserWarning(qtbot: QtBot, global_mmcore: CMMCorePlus):
assert multi_shutter.shutter_button.text() == "None"


@pytest.mark.xfail(reason="flaky test")
def test_multi_shutter_state_changed(qtbot: QtBot, global_mmcore: CMMCorePlus):
mmc = global_mmcore
shutter, shutter1, multi_shutter = _make_shutters(qtbot)
Expand Down

0 comments on commit 676207b

Please sign in to comment.