Skip to content

Commit e5fee48

Browse files
Bump ruff from 0.3.7 to 0.15.17 (#394)
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.7 to 0.15.17. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/releases">ruff's releases</a>.</em></p> <blockquote> <h2>0.15.17</h2> <h2>Release Notes</h2> <p>Released on 2026-06-11.</p> <h3>Preview features</h3> <ul> <li>Allow human-readable names in suppression comments (<a href="https://redirect.github.com/astral-sh/ruff/pull/25614">#25614</a>)</li> <li>Fix handling of <code>ignore</code> comments within a <code>disable</code>/<code>enable</code> pair (<a href="https://redirect.github.com/astral-sh/ruff/pull/25845">#25845</a>)</li> <li>Prioritize human-readable names in CLI output (<a href="https://redirect.github.com/astral-sh/ruff/pull/25869">#25869</a>)</li> <li>Respect diagnostic start and parent ranges and trailing comments in <code>ruff:ignore</code> suppressions (<a href="https://redirect.github.com/astral-sh/ruff/pull/25673">#25673</a>)</li> <li>[<code>flake8-async</code>] Add <code>trio.as_safe_channel</code> to safe decorators (<code>ASYNC119</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25775">#25775</a>)</li> <li>[<code>flake8-pytest-style</code>] Also check <code>pytest_asyncio</code> fixtures (<a href="https://redirect.github.com/astral-sh/ruff/pull/25375">#25375</a>)</li> <li>[<code>ruff</code>] Ban <code>pytest</code> autouse fixtures (<code>RUF076</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25477">#25477</a>)</li> <li>[<code>pyupgrade</code>] Add <code>from __future__ import annotations</code> automatically (<code>UP007</code>, <code>UP045</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23259">#23259</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Fix diagnostic when <code>ruff:enable</code> or <code>ruff:disable</code> appears where <code>ruff:ignore</code> is expected (<a href="https://redirect.github.com/astral-sh/ruff/pull/25700">#25700</a>)</li> <li>[<code>pyupgrade</code>] Preserve leading empty literals to avoid syntax errors (<code>UP032</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25491">#25491</a>)</li> </ul> <h3>Rule changes</h3> <ul> <li>[<code>flake8-pytest-style</code>] Clarify diagnostic message for single parameters (<code>PT007</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25592">#25592</a>)</li> <li>[<code>numpy</code>] Drop autofix for <code>np.in1d</code> (<code>NPY201</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25612">#25612</a>)</li> <li>[<code>pylint</code>] Exempt Python version comparisons (<code>PLR2004</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25743">#25743</a>)</li> </ul> <h3>Performance</h3> <ul> <li>Reserve AST <code>Vec</code>s with correct capacity for common cases (<a href="https://redirect.github.com/astral-sh/ruff/pull/25451">#25451</a>)</li> </ul> <h3>Formatter</h3> <ul> <li>Preserve whitespace for Quarto cell option comments (<a href="https://redirect.github.com/astral-sh/ruff/pull/25641">#25641</a>)</li> </ul> <h3>CLI</h3> <ul> <li>Allow rule names in <code>ruff rule</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/25640">#25640</a>)</li> </ul> <h3>Other changes</h3> <ul> <li>Fix playground diagnostics scrollbars (<a href="https://redirect.github.com/astral-sh/ruff/pull/25642">#25642</a>)</li> </ul> <h3>Contributors</h3> <ul> <li><a href="https://github.com/SuryanshSS1011"><code>@​SuryanshSS1011</code></a></li> <li><a href="https://github.com/anishgirianish"><code>@​anishgirianish</code></a></li> <li><a href="https://github.com/romero-deshaw"><code>@​romero-deshaw</code></a></li> <li><a href="https://github.com/karlhillx"><code>@​karlhillx</code></a></li> <li><a href="https://github.com/carljm"><code>@​carljm</code></a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md">ruff's changelog</a>.</em></p> <blockquote> <h2>0.15.17</h2> <p>Released on 2026-06-11.</p> <h3>Preview features</h3> <ul> <li>Allow human-readable names in suppression comments (<a href="https://redirect.github.com/astral-sh/ruff/pull/25614">#25614</a>)</li> <li>Fix handling of <code>ignore</code> comments within a <code>disable</code>/<code>enable</code> pair (<a href="https://redirect.github.com/astral-sh/ruff/pull/25845">#25845</a>)</li> <li>Prioritize human-readable names in CLI output (<a href="https://redirect.github.com/astral-sh/ruff/pull/25869">#25869</a>)</li> <li>Respect diagnostic start and parent ranges and trailing comments in <code>ruff:ignore</code> suppressions (<a href="https://redirect.github.com/astral-sh/ruff/pull/25673">#25673</a>)</li> <li>[<code>flake8-async</code>] Add <code>trio.as_safe_channel</code> to safe decorators (<code>ASYNC119</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25775">#25775</a>)</li> <li>[<code>flake8-pytest-style</code>] Also check <code>pytest_asyncio</code> fixtures (<a href="https://redirect.github.com/astral-sh/ruff/pull/25375">#25375</a>)</li> <li>[<code>ruff</code>] Ban <code>pytest</code> autouse fixtures (<code>RUF076</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25477">#25477</a>)</li> <li>[<code>pyupgrade</code>] Add <code>from __future__ import annotations</code> automatically (<code>UP007</code>, <code>UP045</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/23259">#23259</a>)</li> </ul> <h3>Bug fixes</h3> <ul> <li>Fix diagnostic when <code>ruff:enable</code> or <code>ruff:disable</code> appears where <code>ruff:ignore</code> is expected (<a href="https://redirect.github.com/astral-sh/ruff/pull/25700">#25700</a>)</li> <li>[<code>pyupgrade</code>] Preserve leading empty literals to avoid syntax errors (<code>UP032</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25491">#25491</a>)</li> </ul> <h3>Rule changes</h3> <ul> <li>[<code>flake8-pytest-style</code>] Clarify diagnostic message for single parameters (<code>PT007</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25592">#25592</a>)</li> <li>[<code>numpy</code>] Drop autofix for <code>np.in1d</code> (<code>NPY201</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25612">#25612</a>)</li> <li>[<code>pylint</code>] Exempt Python version comparisons (<code>PLR2004</code>) (<a href="https://redirect.github.com/astral-sh/ruff/pull/25743">#25743</a>)</li> </ul> <h3>Performance</h3> <ul> <li>Reserve AST <code>Vec</code>s with correct capacity for common cases (<a href="https://redirect.github.com/astral-sh/ruff/pull/25451">#25451</a>)</li> </ul> <h3>Formatter</h3> <ul> <li>Preserve whitespace for Quarto cell option comments (<a href="https://redirect.github.com/astral-sh/ruff/pull/25641">#25641</a>)</li> </ul> <h3>CLI</h3> <ul> <li>Allow rule names in <code>ruff rule</code> (<a href="https://redirect.github.com/astral-sh/ruff/pull/25640">#25640</a>)</li> </ul> <h3>Other changes</h3> <ul> <li>Fix playground diagnostics scrollbars (<a href="https://redirect.github.com/astral-sh/ruff/pull/25642">#25642</a>)</li> </ul> <h3>Contributors</h3> <ul> <li><a href="https://github.com/SuryanshSS1011"><code>@​SuryanshSS1011</code></a></li> <li><a href="https://github.com/anishgirianish"><code>@​anishgirianish</code></a></li> <li><a href="https://github.com/romero-deshaw"><code>@​romero-deshaw</code></a></li> <li><a href="https://github.com/karlhillx"><code>@​karlhillx</code></a></li> <li><a href="https://github.com/carljm"><code>@​carljm</code></a></li> <li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/astral-sh/ruff/commit/7c645a9a1be8258b9f9e005208a55a0b7e8e18f0"><code>7c645a9</code></a> Bump 0.15.17 (<a href="https://redirect.github.com/astral-sh/ruff/issues/25872">#25872</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/f381eb1d54997cfbfa6f63c15dd2d760f70e85e1"><code>f381eb1</code></a> Prioritize human-readable names in CLI output (<a href="https://redirect.github.com/astral-sh/ruff/issues/25869">#25869</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/b9b4546ad27d8fd12acc979e312a3ee25ef8ac4f"><code>b9b4546</code></a> Minor workflow simplification (<a href="https://redirect.github.com/astral-sh/ruff/issues/25870">#25870</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/1e77ba02570bbe4952f7cf0e4ebb97b8b4e6e58d"><code>1e77ba0</code></a> [ty] Move <code>PreformattedBlockScanner</code> to format-agnostic location. (<a href="https://redirect.github.com/astral-sh/ruff/issues/25856">#25856</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/6f2b772285aa478e8aee3f4b54dfa9ce903a0ce1"><code>6f2b772</code></a> [ty] Preserve nominal type of enum.property instances (<a href="https://redirect.github.com/astral-sh/ruff/issues/25849">#25849</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/be4777c8766a38d405a69948989cdfa2674adaae"><code>be4777c</code></a> [ty] Fix site-package error when multiple versions of pythons are installed i...</li> <li><a href="https://github.com/astral-sh/ruff/commit/53f6ff7200983a67778fcba7106019d2615846f0"><code>53f6ff7</code></a> Allow human-readable names in suppression comments (<a href="https://redirect.github.com/astral-sh/ruff/issues/25614">#25614</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/67403254192f3541bd7e1027c8f1805cf7a9c2be"><code>6740325</code></a> [ty] Restrict uncached raw signature access (<a href="https://redirect.github.com/astral-sh/ruff/issues/25866">#25866</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/970b1bf4a4d83359c9e28cad5f127ebbd6769682"><code>970b1bf</code></a> Auto-update snapshots when syncing typeshed (<a href="https://redirect.github.com/astral-sh/ruff/issues/25841">#25841</a>)</li> <li><a href="https://github.com/astral-sh/ruff/commit/0785793750fd6c74124a189259822f1a28eb5c13"><code>0785793</code></a> Fix handling of <code>ignore</code> comments within a <code>disable</code>/<code>enable</code> pair (<a href="https://redirect.github.com/astral-sh/ruff/issues/25845">#25845</a>)</li> <li>Additional commits viewable in <a href="https://github.com/astral-sh/ruff/compare/v0.3.7...0.15.17">compare view</a></li> </ul> </details> <br /> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Snare <andrew.snare@databricks.com>
1 parent 2141b30 commit e5fee48

6 files changed

Lines changed: 40 additions & 39 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lint = [
3939
"mypy~=2.1.0",
4040
"pylint~=4.0.5",
4141
"pylint-pytest==2.0.0a1",
42-
"ruff~=0.3.4",
42+
"ruff~=0.15.17",
4343
"types-PyYAML~=6.0.12",
4444
"types-requests~=2.33",
4545
]

src/databricks/labs/blueprint/installation.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def _get_type_ref(cls, inst) -> type:
484484
"""The `_get_type_ref` method is a private method that is used to determine the type of an object. This method
485485
is called by the `save` method."""
486486
type_ref = type(inst)
487-
if type_ref == list:
487+
if type_ref is list:
488488
return cls._get_list_type_ref(inst)
489489
return type_ref
490490

@@ -509,9 +509,9 @@ def _marshal(self, type_ref: type, path: list[str], inst: Any) -> tuple[Any, boo
509509
return inst.as_dict(), True
510510
if dataclasses.is_dataclass(type_ref):
511511
return self._marshal_dataclass(type_ref, path, inst)
512-
if type_ref == list:
512+
if type_ref is list:
513513
return self._marshal_raw_list(path, inst)
514-
if type_ref == dict:
514+
if type_ref is dict:
515515
return self._marshal_raw_dict(path, inst)
516516
if isinstance(type_ref, enum.EnumMeta):
517517
return self._marshal_enum(inst)
@@ -532,7 +532,7 @@ def _marshal_generic_types(self, type_ref: type, path: list[str], inst: Any) ->
532532
if type_ref.__origin__ in (dict, list) or isinstance(type_ref, types.GenericAlias):
533533
return self._marshal_generic(type_ref, path, inst)
534534
return self._marshal_generic_alias(type_ref, inst)
535-
raise SerdeError(f'{".".join(path)}: unknown: {inst}')
535+
raise SerdeError(f"{'.'.join(path)}: unknown: {inst}")
536536

537537
def _marshal_union(self, type_ref: type, path: list[str], inst: Any) -> tuple[Any, bool]:
538538
"""The `_marshal_union` method is a private method that is used to serialize an object of type `type_ref` to
@@ -543,7 +543,7 @@ def _marshal_union(self, type_ref: type, path: list[str], inst: Any) -> tuple[An
543543
if ok:
544544
return value, True
545545
combo.append(self._explain_why(variant, [*path, f"(as {variant})"], inst))
546-
raise SerdeError(f'{".".join(path)}: union: {" or ".join(combo)}')
546+
raise SerdeError(f"{'.'.join(path)}: union: {' or '.join(combo)}")
547547

548548
def _marshal_generic(self, type_ref: type, path: list[str], inst: Any) -> tuple[Any, bool]:
549549
"""The `_marshal_generic` method is a private method that is used to serialize an object of type `type_ref`
@@ -719,18 +719,18 @@ def _unmarshal_generic_types(cls, type_ref, path, inst):
719719
_UnionGenericAlias,
720720
)
721721

722-
if type_ref == list:
722+
if type_ref is list:
723723
msg = f"{'.'.join(path)}: raw list encountered; use list[type] instead: {inst}"
724724
raise SerdeError(msg)
725-
if type_ref == dict:
725+
if type_ref is dict:
726726
msg = f"{'.'.join(path)}: raw dict encountered; use dict[str,type] instead: {inst}"
727727
raise SerdeError(msg)
728728

729729
if isinstance(type_ref, (types.UnionType, _UnionGenericAlias)):
730730
return cls._unmarshal_union(inst, path, type_ref)
731731
if isinstance(type_ref, (_GenericAlias, types.GenericAlias)):
732732
return cls._unmarshal_generic(inst, path, type_ref)
733-
raise SerdeError(f'{".".join(path)}: unknown: {type_ref}: {inst}')
733+
raise SerdeError(f"{'.'.join(path)}: unknown: {type_ref}: {inst}")
734734

735735
@classmethod
736736
def _unmarshal_dataclass(cls, inst, path, type_ref):
@@ -858,15 +858,15 @@ def _unmarshal_primitive(cls, inst: Any, path: list[str], type_ref: type) -> Any
858858
# Some special cases:
859859
# - str -> bool: only accept "true" or "false" (case-insensitive).
860860
# - float -> int: refuse to truncate
861-
if type_ref == bool:
861+
if type_ref is bool:
862862
if isinstance(inst, str):
863863
if inst.lower() == "true":
864864
return True
865865
if inst.lower() == "false":
866866
return False
867867
msg = f"{'.'.join(path)}: Expected bool, got: {inst}"
868868
raise SerdeError(msg)
869-
if type_ref == int and isinstance(inst, float):
869+
if type_ref is int and isinstance(inst, float):
870870
msg = f"{'.'.join(path)}: Expected int, got float: {inst}"
871871
raise SerdeError(msg)
872872

@@ -885,7 +885,7 @@ def _explain_why(type_ref: type, path: list[str], raw: Any) -> str:
885885
if raw is None:
886886
raw = "value is missing"
887887
type_name = getattr(type_ref, "__name__", str(type_ref))
888-
return f'{".".join(path)}: not a {type_name}: {raw}'
888+
return f"{'.'.join(path)}: not a {type_name}: {raw}"
889889

890890
@staticmethod
891891
def _dump_json(as_dict: JsonValue, _: type) -> bytes:
@@ -1071,7 +1071,7 @@ def _assert_upload(filename: Any, loc: dict[str, bytes], expected: bytes | None
10711071
if expected:
10721072
assert loc[name] == expected, f"{filename} content missmatch"
10731073
return
1074-
raise AssertionError(f'Cannot find {filename.pattern} among {", ".join(loc.keys())}')
1074+
raise AssertionError(f"Cannot find {filename.pattern} among {', '.join(loc.keys())}")
10751075
assert filename in loc, f"{filename} had no writes"
10761076
if expected:
10771077
assert loc[filename] == expected, f"{filename} content missmatch"

src/databricks/labs/blueprint/parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class ManyError(RuntimeError):
2222
def __init__(self, errs: Sequence[BaseException]):
2323
strs = sorted({f"{_.__class__.__name__}: {_!s}" for _ in errs})
24-
msg = f'Detected {len(errs)} failures: {", ".join(strs)}'
24+
msg = f"Detected {len(errs)} failures: {', '.join(strs)}"
2525
super().__init__(msg)
2626
self.errs = errs
2727

tests/unit/test_logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,13 @@ async def test_readlines_small_reads() -> None:
477477
((b"1", b"12\n45\n78\n0", b"12\n"), ("112", "45", "78", "012")),
478478
# A very long line, with some existing data in the buffer, and leaving some remainder.
479479
(
480-
(b"12", b"3456789012" b"3456789012" b"3456789012" b"34567890\n1234"),
480+
(b"12", b"3456789012" + b"3456789012" + b"3456789012" + b"34567890\n1234"),
481481
("1234567890+", "1234567890+", "1234567890+", "1234567890+", "", "1234!"),
482482
),
483483
# A \r\n newline split across reads.
484484
((b"1234\r", b"\nabcd\n"), ("1234", "abcd")),
485485
# A \r\n split exactly on the limit.
486-
((b"123456789\r" b"\nabcd\n",), ("123456789+", "", "abcd")),
486+
((b"123456789\r" + b"\nabcd\n",), ("123456789+", "", "abcd")),
487487
),
488488
)
489489
async def test_readlines_line_exceeds_limit(data_chunks: Sequence[bytes], expected_messages: Sequence[str]) -> None:

tests/unit/test_parallel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ def test_cpu_count_source_process_cpu_count() -> None:
174174
):
175175
assert Threads.available_cpu_count() == 13, "Should use os.process_cpu_count() if available"
176176
assert mock_process_cpu_count.called, "os.process_cpu_count() should be called"
177-
assert (
178-
not mock_sched_getaffinity.called
179-
), "os.sched_getaffinity() should not be called if os.process_cpu_count() is available"
177+
assert not mock_sched_getaffinity.called, (
178+
"os.sched_getaffinity() should not be called if os.process_cpu_count() is available"
179+
)
180180
assert not mock_cpu_count.called, "os.cpu_count() should not be called if os.process_cpu_count() is available"
181181

182182

uv.lock

Lines changed: 21 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)