Skip to content

Commit 69c2808

Browse files
ci(pre-commit.ci): autoupdate (#689)
* ci(pre-commit.ci): autoupdate updates: - [github.com/crate-ci/typos: dictgen-v0.3.1 → typos-dict-v0.12.4](crate-ci/typos@dictgen-v0.3.1...typos-dict-v0.12.4) - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.4](astral-sh/ruff-pre-commit@v0.8.6...v0.9.4) * style(pre-commit.ci): auto fixes [...] * update pre-commit and fix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Talley Lambert <[email protected]>
1 parent f5e89e5 commit 69c2808

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ repos:
1010
- id: validate-pyproject
1111

1212
- repo: https://github.com/crate-ci/typos
13-
rev: dictgen-v0.3.1
13+
rev: v1.29.9
1414
hooks:
1515
- id: typos
1616

1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.8.6
18+
rev: v0.9.7
1919
hooks:
2020
- id: ruff
2121
args: ["--fix", "--unsafe-fixes"]
2222
- id: ruff-format
2323

2424
- repo: https://github.com/pre-commit/mirrors-mypy
25-
rev: v1.14.1
25+
rev: v1.15.0
2626
hooks:
2727
- id: mypy
2828
files: "^src/"

src/magicgui/application.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ def _use(self, backend_name: str | None = None) -> None:
5454
backend_name = DEFAULT_BACKEND
5555
if not backend_name or backend_name.lower() not in BACKENDS:
5656
raise ValueError(
57-
f"backend_name must be one of {set(BACKENDS)!r}, "
58-
f"not {backend_name!r}"
57+
f"backend_name must be one of {set(BACKENDS)!r}, not {backend_name!r}"
5958
)
6059

6160
module_name, _ = BACKENDS[backend_name]

src/magicgui/backends/_ipynb/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def _mgui_set_icon_size(self, size: int | (tuple[int, int] | None)) -> None:
397397
for child in self._ipywidget.children:
398398
if hasattr(child, "style"):
399399
child.style.font_size = f"{sz}px" if sz else None
400-
child.layout.min_height = f"{sz*2}px" if sz else None
400+
child.layout.min_height = f"{sz * 2}px" if sz else None
401401

402402
def _mgui_clear(self) -> None:
403403
"""Clear the toolbar."""

src/magicgui/backends/_qtpy/widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,6 @@ def _format_number(text: str, ndigits: int = 4) -> str:
16191619
if 0.1 <= abs(value) < 10 ** (ndigits + 1) or value == 0:
16201620
text = str(value) if isinstance(value, int) else f"{value:.{ndigits}f}"
16211621
else:
1622-
text = f"{value:.{ndigits-1}e}"
1622+
text = f"{value:.{ndigits - 1}e}"
16231623

16241624
return text

src/magicgui/widgets/_function_gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def _docstring_to_html(docs: str) -> str:
495495

496496
ptemp = "<li><p><strong>{}</strong> (<em>{}</em>) - {}</p></li>"
497497
plist = [ptemp.format(p.arg_name, p.type_name, p.description) for p in ds.params]
498-
params = f'<h3>Parameters</h3><ul>{"".join(plist)}</ul>'
498+
params = f"<h3>Parameters</h3><ul>{''.join(plist)}</ul>"
499499
short = f"<p>{ds.short_description}</p>" if ds.short_description else ""
500500
long = f"<p>{ds.long_description}</p>" if ds.long_description else ""
501501
return re.sub(r"`?([^`]+)`?", r"<code>\1</code>", f"{short}{long}{params}")

src/magicgui/widgets/_image/_mpl_image.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ def to_rgba(self, x, bytes=False, norm=True):
388388
if xx.dtype.kind == "f":
389389
if norm and (xx.max() > 1 or xx.min() < 0):
390390
raise ValueError(
391-
"Floating point image RGB values "
392-
"must be in the 0..1 range."
391+
"Floating point image RGB values must be in the 0..1 range."
393392
)
394393
if bytes:
395394
xx = (xx * 255).astype(np.uint8)
@@ -545,7 +544,7 @@ def set_data(
545544
self._A.dtype, float, "same_kind"
546545
):
547546
raise TypeError(
548-
f"Image data of dtype {self._A.dtype} cannot be converted to " "float"
547+
f"Image data of dtype {self._A.dtype} cannot be converted to float"
549548
)
550549

551550
if self._A.ndim == 3 and self._A.shape[-1] == 1:
@@ -599,7 +598,7 @@ def _make_image(self, A):
599598
"""
600599
if A is None:
601600
raise RuntimeError(
602-
"You must first set the image " "array or the image attribute"
601+
"You must first set the image array or the image attribute"
603602
)
604603
if A.size == 0:
605604
raise RuntimeError(

0 commit comments

Comments
 (0)