Skip to content

Commit 7c23819

Browse files
olivermeyerclaude
andcommitted
fix(deps): adapt lint and tests to ruff 0.16 and typer 0.27
Lock file maintenance bumped ruff (0.15->0.16) and typer (0.26->0.27), breaking CI: - ruff 0.16 stabilizes PLR0917 (too-many-positional-arguments) into the ALL selection; append PLR0917 to the existing per-site noqa on the 34 affected functions (PLR0913 stays, it is an independent rule). - ruff 0.16 formats Python code blocks embedded in Markdown; reformat the snippet in tests/CLAUDE.md accordingly. - typer 0.27 renders the missing-argument metavar as the parameter name ('run_id') instead of upper-case ('RUN_ID'); update the assertion in test_cli_run_result_delete_fails_on_no_arg. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 961efcd commit 7c23819

14 files changed

Lines changed: 39 additions & 38 deletions

File tree

src/aignostics/application/_cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def application_describe( # noqa: C901, PLR0912
427427

428428

429429
@run_app.command(name="execute")
430-
def run_execute( # noqa: PLR0913
430+
def run_execute( # noqa: PLR0913, PLR0917
431431
application_id: Annotated[
432432
str,
433433
typer.Argument(help="Id of application version to execute."),
@@ -641,7 +641,7 @@ def run_prepare(
641641

642642

643643
@run_app.command(name="upload")
644-
def run_upload( # noqa: PLR0913
644+
def run_upload( # noqa: PLR0913, PLR0917
645645
application_id: Annotated[
646646
str,
647647
typer.Argument(help="Id of the application to upload data for. "),
@@ -754,7 +754,7 @@ def update_progress(bytes_uploaded: int, source: Path, platform_bucket_url: str)
754754

755755

756756
@run_app.command("submit")
757-
def run_submit( # noqa: PLR0913
757+
def run_submit( # noqa: PLR0913, PLR0917
758758
application_id: Annotated[
759759
str,
760760
typer.Argument(help="Id of the application to submit run for."),
@@ -889,7 +889,7 @@ def run_submit( # noqa: PLR0913
889889

890890

891891
@run_app.command("list")
892-
def run_list( # noqa: PLR0913
892+
def run_list( # noqa: PLR0913, PLR0917
893893
verbose: Annotated[bool, typer.Option(help="Show application details")] = False,
894894
limit: Annotated[int | None, typer.Option(help="Maximum number of runs to display")] = None,
895895
tags: Annotated[
@@ -1642,7 +1642,7 @@ def run_share_token_revoke(
16421642

16431643

16441644
@result_app.command("download")
1645-
def result_download( # noqa: C901, PLR0913, PLR0915
1645+
def result_download( # noqa: C901, PLR0913, PLR0915, PLR0917
16461646
run_id: Annotated[str, typer.Argument(..., help="Id of the run to download results for")],
16471647
destination_directory: Annotated[
16481648
Path,

src/aignostics/application/_download.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def update_progress(
146146
download_progress_queue.put_nowait(progress)
147147

148148

149-
def download_available_items( # noqa: PLR0913
149+
def download_available_items( # noqa: PLR0913, PLR0917
150150
progress: DownloadProgress,
151151
application_run: Run,
152152
destination_directory: Path,
@@ -223,7 +223,7 @@ def download_available_items( # noqa: PLR0913
223223
downloaded_items.add(item.external_id)
224224

225225

226-
def download_item_artifact( # noqa: PLR0913
226+
def download_item_artifact( # noqa: PLR0913, PLR0917
227227
progress: DownloadProgress,
228228
run: Run,
229229
artifact: Any, # noqa: ANN401
@@ -285,7 +285,7 @@ def download_item_artifact( # noqa: PLR0913
285285
)
286286

287287

288-
def download_file_with_progress( # noqa: PLR0913
288+
def download_file_with_progress( # noqa: PLR0913, PLR0917
289289
progress: DownloadProgress,
290290
signed_url: str,
291291
artifact_path: Path,

src/aignostics/application/_gui/_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SearchInput:
2929
_runs_last_refresh_time: datetime | None = None
3030

3131

32-
async def _frame( # noqa: C901, PLR0913, PLR0915
32+
async def _frame( # noqa: C901, PLR0913, PLR0915, PLR0917
3333
navigation_title: str,
3434
navigation_icon: str | None = None,
3535
navigation_icon_color: str | None = None,

src/aignostics/application/_service.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def _apply_mappings_to_entry(entry: dict[str, Any], mappings: list[str]) -> None
320320
Service._process_key_value_pair(entry, key_value, external_id)
321321

322322
@staticmethod
323-
def generate_metadata_from_source_directory( # noqa: PLR0913
323+
def generate_metadata_from_source_directory( # noqa: PLR0913, PLR0917
324324
source_directory: Path,
325325
application_id: str,
326326
application_version: str | None = None,
@@ -432,7 +432,7 @@ def generate_metadata_from_source_directory( # noqa: PLR0913
432432
raise RuntimeError(message) from e
433433

434434
@staticmethod
435-
def application_run_upload( # noqa: PLR0913
435+
def application_run_upload( # noqa: PLR0913, PLR0917
436436
application_id: str,
437437
metadata: list[dict[str, Any]],
438438
application_version: str | None = None,
@@ -501,7 +501,7 @@ def application_run_upload( # noqa: PLR0913
501501
open(source_file_path, "rb") as f,
502502
):
503503

504-
def read_in_chunks( # noqa: PLR0913
504+
def read_in_chunks( # noqa: PLR0913, PLR0917
505505
external_id: str,
506506
file_size: int,
507507
upload_progress_queue: Any | None = None, # noqa: ANN401
@@ -535,7 +535,7 @@ def read_in_chunks( # noqa: PLR0913
535535
return True
536536

537537
@staticmethod
538-
def application_runs_static( # noqa: PLR0913
538+
def application_runs_static( # noqa: PLR0913, PLR0917
539539
application_id: str | None = None,
540540
application_version: str | None = None,
541541
external_id: str | None = None,
@@ -606,7 +606,7 @@ def application_runs_static( # noqa: PLR0913
606606
)
607607
]
608608

609-
def application_runs( # noqa: C901, PLR0912, PLR0913, PLR0915
609+
def application_runs( # noqa: C901, PLR0912, PLR0913, PLR0915, PLR0917
610610
self,
611611
application_id: str | None = None,
612612
application_version: str | None = None,
@@ -828,7 +828,7 @@ def application_run(self, run_id: str, share_token: str | None = None) -> Run:
828828
logger.exception(message)
829829
raise RuntimeError(message) from e
830830

831-
def application_run_submit_from_metadata( # noqa: PLR0913
831+
def application_run_submit_from_metadata( # noqa: PLR0913, PLR0917
832832
self,
833833
application_id: str,
834834
metadata: list[dict[str, Any]],
@@ -996,7 +996,7 @@ def application_run_submit_from_metadata( # noqa: PLR0913
996996
logger.exception(message)
997997
raise RuntimeError(message) from e
998998

999-
def application_run_submit( # noqa: PLR0913, PLR0912, C901, PLR0915
999+
def application_run_submit( # noqa: PLR0913, PLR0912, C901, PLR0915, PLR0917
10001000
self,
10011001
application_id: str,
10021002
items: list[InputItem],
@@ -1629,7 +1629,7 @@ def application_run_revoke_share_token(self, run_id: str, share_token_id: str) -
16291629
raise NotFoundException(message)
16301630

16311631
@staticmethod
1632-
def application_run_download_static( # noqa: PLR0913
1632+
def application_run_download_static( # noqa: PLR0913, PLR0917
16331633
run_id: str,
16341634
destination_directory: Path,
16351635
create_subdirectory_for_run: bool = True,
@@ -1674,7 +1674,7 @@ def application_run_download_static( # noqa: PLR0913
16741674
download_progress_queue,
16751675
)
16761676

1677-
def application_run_download( # noqa: C901, PLR0912, PLR0913, PLR0915
1677+
def application_run_download( # noqa: C901, PLR0912, PLR0913, PLR0915, PLR0917
16781678
self,
16791679
run_id: str,
16801680
destination_directory: Path,

src/aignostics/platform/resources/applications.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def _prepare_document_request(
515515
return endpoint_url, token_provider, ssl_verify, proxy
516516

517517
# Private helper; splitting params would require a thin DTO.
518-
def _stream_document( # noqa: PLR0913
518+
def _stream_document( # noqa: PLR0913, PLR0917
519519
self,
520520
url: str,
521521
write_chunk: t.Callable[[bytes], object],

src/aignostics/platform/resources/runs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ def __call__(self, run_id: str) -> Run:
909909
"""
910910
return Run(self._api, run_id)
911911

912-
def submit( # noqa: PLR0913
912+
def submit( # noqa: PLR0913, PLR0917
913913
self,
914914
application_id: str,
915915
items: list[ItemCreationRequest],
@@ -983,7 +983,7 @@ def submit( # noqa: PLR0913
983983
operation_cache_clear() # Clear all caches since we added a new run
984984
return Run(self._api, str(res.run_id))
985985

986-
def list( # noqa: PLR0913
986+
def list( # noqa: PLR0913, PLR0917
987987
self,
988988
application_id: str | None = None,
989989
application_version: str | None = None,
@@ -1031,7 +1031,7 @@ def list( # noqa: PLR0913
10311031
)
10321032
)
10331033

1034-
def list_data( # noqa: PLR0913
1034+
def list_data( # noqa: PLR0913, PLR0917
10351035
self,
10361036
application_id: str | None = None,
10371037
application_version: str | None = None,

src/aignostics/qupath/_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def get_installation_path() -> Path:
428428
return Path(platformdirs.user_data_dir(__project_name__)).resolve()
429429

430430
@staticmethod
431-
def _download_qupath( # noqa: C901, PLR0912, PLR0913, PLR0915
431+
def _download_qupath( # noqa: C901, PLR0912, PLR0913, PLR0915, PLR0917
432432
version: str,
433433
path: Path,
434434
platform_system: str | None = None,
@@ -759,7 +759,7 @@ def _extract_qupath( # noqa: C901, PLR0912, PLR0915
759759
raise RuntimeError(message)
760760

761761
@staticmethod
762-
def install_qupath( # noqa: PLR0913
762+
def install_qupath( # noqa: PLR0913, PLR0917
763763
version: str = QUPATH_VERSION,
764764
path: Path | None = None,
765765
reinstall: bool = True,

src/aignostics/utils/_gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def gui_register_pages() -> None:
3030
page_builder.register_pages()
3131

3232

33-
def gui_run( # noqa: PLR0913
33+
def gui_run( # noqa: PLR0913, PLR0917
3434
native: bool = True,
3535
show: bool = False,
3636
host: str | None = None,

tests/CLAUDE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ The decorator intercepts `nocache` and does not pass it to the wrapped function.
8080
@cached_operation(ttl=60)
8181
def f() -> int: ...
8282

83-
f() # populates cache
84-
f() # cache hit, f not re-run
85-
f(nocache=True) # re-runs f, refreshes cache
83+
84+
f() # populates cache
85+
f() # cache hit, f not re-run
86+
f(nocache=True) # re-runs f, refreshes cache
8687
```
8788

8889
See `nocache_test.py` for the full decorator / client / edge-case coverage.

tests/aignostics/application/cli_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ def test_cli_run_result_delete_fails_on_no_arg(runner: CliRunner, record_propert
13071307
"""Check run result delete command runs successfully."""
13081308
record_property("tested-item-id", "SPEC-APPLICATION-SERVICE")
13091309
result = runner.invoke(cli, ["application", "run", "result", "delete"])
1310-
assert "Missing argument 'RUN_ID'." in normalize_output(result.stderr)
1310+
assert "Missing argument 'run_id'." in normalize_output(result.stderr)
13111311
assert result.exit_code == 2
13121312

13131313

0 commit comments

Comments
 (0)