Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,13 @@ def audit(session: nox.Session) -> None:
"--with-description",
]

pip_licenses_base_args.extend([
"--ignore-packages",
"aignostics",
"pyinstaller", # https://pyinstaller.org/en/stable/license.html
])
pip_licenses_base_args.extend(
[
"--ignore-packages",
"aignostics",
"pyinstaller", # https://pyinstaller.org/en/stable/license.html
]
)

# Filter by .license-types-allowed file if it exists
allowed_licenses = []
Expand Down Expand Up @@ -657,7 +659,7 @@ def docs(session: nox.Session) -> None:

@nox.session(python=[PYTHON_VERSION], default=False)
def docs_pdf(session: nox.Session) -> None:
"""Setup dev environment post project creation.""" # noqa: DOC501
"""Setup dev environment post project creation."""
_setup_venv(session, True)
try:
out = session.run("latexmk", "--version", external=True, silent=True)
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ allow-direct-references = true

[tool.ruff]
target-version = "py311"
preview = true
preview = false
fix = true
line-length = 120
extend-exclude = [
Expand Down Expand Up @@ -298,7 +298,8 @@ ignore = [
"T201", # Remove `print`
"INP001", # Checks for packages that are missing an __init__.py file.
"BLE001", # Accept for now TODO(Helmut): Add proper exception handling later
"ASYNC240" # Aiopath broken in Python 3.11 which we want to support
"ASYNC240", # Aiopath broken in Python 3.11 which we want to support
"PLW0717" # Allow try-clauses with more than 5 statements
]

[tool.ruff.lint.per-file-ignores]
Expand Down
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ sonar.python.version=3.11, 3.12, 3.13
sonar.python.coverage.reportPaths=reports/coverage.xml
sonar.coverage.exclusions=noxfile.py, template/**, tests/**, examples/**, docs/**, dist/**, dist_vercel/**, dist_native/**, **/third_party/**, codegen/**, **/_notebook.py, **/_pydicom_handler.py, **/_openslide_handler.py
sonar.exclusions=template/**, examples/**, docs/**, dist/**, dist_vercel/**, dist_native/**, **/third_party/**, codegen/**, **/_notebook.py

# Suppress cognitive complexity findings in complex but intentional functions
sonar.issue.ignore.multicriteria=e1,e2,e3,e4
sonar.issue.ignore.multicriteria.e1.ruleKey=python:S3776
sonar.issue.ignore.multicriteria.e1.resourceKey=src/aignostics/application/_gui/_page_application_run_describe.py
sonar.issue.ignore.multicriteria.e2.ruleKey=python:S3776
sonar.issue.ignore.multicriteria.e2.resourceKey=src/aignostics/application/_service.py
sonar.issue.ignore.multicriteria.e3.ruleKey=python:S3776
sonar.issue.ignore.multicriteria.e3.resourceKey=src/aignostics/wsi/_pydicom_handler.py
# Suppress unnecessary async finding in GUI page (async required by NiceGUI framework)
sonar.issue.ignore.multicriteria.e4.ruleKey=python:S6966
sonar.issue.ignore.multicriteria.e4.resourceKey=src/aignostics/application/_gui/_page_application_describe.py
2 changes: 1 addition & 1 deletion src/aignostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
sys.argv = [module_name, *module_args]
try:
if module_name == "marimo":
from marimo._cli.cli import main # noqa: PLC2701
from marimo._cli.cli import main

main(prog_name="marimo")
else:
Expand Down
10 changes: 5 additions & 5 deletions src/aignostics/application/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def application_describe( # noqa: C901, PLR0912


@run_app.command(name="execute")
def run_execute( # noqa: PLR0913, PLR0917
def run_execute( # noqa: PLR0913
application_id: Annotated[
str,
typer.Argument(help="Id of application version to execute."),
Expand Down Expand Up @@ -636,7 +636,7 @@ def run_prepare(


@run_app.command(name="upload")
def run_upload( # noqa: PLR0913, PLR0917
def run_upload( # noqa: PLR0913
application_id: Annotated[
str,
typer.Argument(help="Id of the application to upload data for. "),
Expand Down Expand Up @@ -749,7 +749,7 @@ def update_progress(bytes_uploaded: int, source: Path, platform_bucket_url: str)


@run_app.command("submit")
def run_submit( # noqa: PLR0913, PLR0917
def run_submit( # noqa: PLR0913
application_id: Annotated[
str,
typer.Argument(help="Id of the application to submit run for."),
Expand Down Expand Up @@ -884,7 +884,7 @@ def run_submit( # noqa: PLR0913, PLR0917


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


@result_app.command("download")
def result_download( # noqa: C901, PLR0913, PLR0915, PLR0917
def result_download( # noqa: C901, PLR0913, PLR0915
run_id: Annotated[str, typer.Argument(..., help="Id of the run to download results for")],
destination_directory: Annotated[
Path,
Expand Down
6 changes: 3 additions & 3 deletions src/aignostics/application/_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def update_progress(
download_progress_queue.put_nowait(progress)


def download_available_items( # noqa: PLR0913, PLR0917
def download_available_items( # noqa: PLR0913
progress: DownloadProgress,
application_run: Run,
destination_directory: Path,
Expand Down Expand Up @@ -223,7 +223,7 @@ def download_available_items( # noqa: PLR0913, PLR0917
downloaded_items.add(item.external_id)


def download_item_artifact( # noqa: PLR0913, PLR0917
def download_item_artifact( # noqa: PLR0913
progress: DownloadProgress,
run: Run,
artifact: Any, # noqa: ANN401
Expand Down Expand Up @@ -285,7 +285,7 @@ def download_item_artifact( # noqa: PLR0913, PLR0917
)


def download_file_with_progress( # noqa: PLR0913, PLR0917
def download_file_with_progress( # noqa: PLR0913
progress: DownloadProgress,
signed_url: str,
artifact_path: Path,
Expand Down
17 changes: 7 additions & 10 deletions src/aignostics/application/_gui/_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SearchInput:
_runs_last_refresh_time: datetime | None = None


async def _frame( # noqa: C901, PLR0913, PLR0915, PLR0917
async def _frame( # noqa: C901, PLR0913, PLR0915
navigation_title: str,
navigation_icon: str | None = None,
navigation_icon_color: str | None = None,
Expand All @@ -45,7 +45,7 @@ async def _frame( # noqa: C901, PLR0913, PLR0915, PLR0917
else:
search_input.query = ""

with frame( # noqa: PLR1702
with frame(
navigation_title=navigation_title,
navigation_icon=navigation_icon,
navigation_icon_color=navigation_icon_color,
Expand All @@ -58,16 +58,15 @@ async def _frame( # noqa: C901, PLR0913, PLR0915, PLR0917
try:
applications = await nicegui_run.io_bound(Service.applications_static)
if applications is None:
message = ( # type: ignore[unreachable]
message = (
"nicegui_run.io_bound(Service.applications_static) returned None, "
"likely canceled by application shutdown."
)
logger.error(message)
raise RuntimeError(message) # noqa: TRY301
for application in applications:
with (
ui
.item(
ui.item(
on_click=lambda app_id=application.application_id: ui.navigate.to(f"/application/{app_id}")
)
.mark(f"SIDEBAR_APPLICATION:{application.application_id}")
Expand Down Expand Up @@ -113,7 +112,7 @@ async def application_runs_load_and_render( # noqa: C901, PLR0915
query=query,
)
if runs is None:
message = ( # type: ignore[unreachable]
message = (
"nicegui_run.io_bound(Service.application_runs_static) returned None, "
"likely canceled by shutdown."
)
Expand Down Expand Up @@ -144,8 +143,7 @@ async def application_runs_load_and_render( # noqa: C901, PLR0915
runs_column.clear()
for index, run_data in enumerate(runs) if runs else []:
with (
ui
.item(
ui.item(
on_click=lambda run_id=run_data["run_id"]: ui.navigate.to(f"/application/run/{run_id}")
)
.props("clickable")
Expand Down Expand Up @@ -228,8 +226,7 @@ def _on_tag_click(t: str = tag) -> None:
@ui.refreshable
async def _runs_list() -> None:
with (
ui
.scroll_area()
ui.scroll_area()
.props('id="runs-list-container"')
.classes("w-full")
.style("height: calc(100vh - 250px);")
Expand Down
Loading
Loading