diff --git a/.gitignore b/.gitignore index 16ae1db05..1da15adde 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ src/scaler/protocol/capnp/*.h # AWS HPC test-generated files .scaler_aws_batch_config.json .scaler_aws_hpc.env + +# Per-user agent preferences (not committed) +.agents-local.md diff --git a/AGENTS.md b/AGENTS.md index 81c6c1a3f..b99419ce9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -143,16 +143,27 @@ Both C++ and Python code share these standards: ### Setting Up Development Environment +The devcontainer (`.devcontainer/`) comes with all C++ dependencies pre-installed (CMake, GCC, Cap'n Proto, Boost, +libuv) as well as `uv`. You can detect the devcontainer via the `REMOTE_CONTAINERS=true` environment variable. +When running in the devcontainer, skip the C++ dependency setup steps below. + +The C++ components are built automatically by `uv pip install -e .` via `scikit-build-core`, so a separate +`./scripts/build.sh` step is only needed for standalone C++ development or testing. + ```bash -# Setup C++ dependencies +# Create and activate a virtual environment +uv venv .venv +source .venv/bin/activate + +# Install Python package in development mode (also builds C++ components) +uv pip install -e . + +# Setup C++ dependencies (skip in devcontainer — already installed) ./scripts/library_tool.sh capnp download ./scripts/library_tool.sh capnp compile ./scripts/library_tool.sh capnp install -# Install Python package in development mode -pip install -e . - -# Building C++ components +# Building C++ components standalone (only if needed outside of pip install) ./scripts/build.sh ``` @@ -164,3 +175,11 @@ python -m unittest discover # Python ``` When writing tests, try to match the directory and module/namespace structure of the code under test. + +### Per-User Configuration + +Developer-specific preferences (e.g. build parallelism limits, preferred tools) should go in a `.agents-local.md` +file in the project root. This file is gitignored and will not be committed. + +**IMPORTANT:** Agents **MUST** read `.agents-local.md` before performing any build, install, or terminal command. +Its contents are mandatory overrides to this file and must always be followed. diff --git a/CLAUDE.md b/CLAUDE.md index eef4bd20c..349b322e0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1 +1,2 @@ -@AGENTS.md \ No newline at end of file +@AGENTS.md +@.agents-local.md \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 62f94f5d5..240984082 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,8 +43,8 @@ gui = [ ] graphblas = [ "python-graphblas==2023.7.0; python_version == '3.8'", - "python-graphblas==2024.2.0; python_version == '3.9'", - "python-graphblas==2024.2.0; python_version >= '3.10'", + "python-graphblas==2024.2.0; python_version >= '3.9' and python_version < '3.11'", + "python-graphblas==2025.2.0; python_version >= '3.11'", "numpy==1.24.4; python_version == '3.8'", "numpy==2.0.2; python_version == '3.9'", "numpy==2.2.6; python_version >= '3.10'", @@ -53,16 +53,10 @@ aws = [ "boto3", ] all = [ - "nicegui[plotly]==2.24.2; python_version == '3.8'", - "nicegui[plotly]==3.6.1; python_version >= '3.9'", - "python-graphblas==2023.7.0; python_version == '3.8'", - "python-graphblas==2024.2.0; python_version == '3.9'", - "python-graphblas==2024.2.0; python_version >= '3.10'", - "numpy==1.24.4; python_version == '3.8'", - "numpy==2.0.2; python_version == '3.9'", - "numpy==2.2.6; python_version >= '3.10'", - "uvloop; platform_system != 'Windows'", - "boto3", + "opengris-scaler[aws]", + "opengris-scaler[graphblas]", + "opengris-scaler[gui]", + "opengris-scaler[uvloop]", ] [dependency-groups] diff --git a/src/scaler/ui/common/task_graph.py b/src/scaler/ui/common/task_graph.py index 79a6343c8..aa730d7b0 100644 --- a/src/scaler/ui/common/task_graph.py +++ b/src/scaler/ui/common/task_graph.py @@ -13,6 +13,7 @@ from scaler.ui.common.setting_page import Settings from scaler.ui.common.utility import ( COMPLETED_TASK_STATUSES, + NICEGUI_MAJOR_VERSION, display_capabilities, format_timediff, format_worker_name, @@ -20,7 +21,6 @@ make_taskstream_ticks, make_tick_text, ) -from scaler.ui.util import NICEGUI_MAJOR_VERSION TASK_STREAM_BACKGROUND_COLOR = "white" TASK_STREAM_BACKGROUND_COLOR_RGB = "#000000" diff --git a/src/scaler/ui/common/task_log.py b/src/scaler/ui/common/task_log.py index 93e6edc0f..41acbf53d 100644 --- a/src/scaler/ui/common/task_log.py +++ b/src/scaler/ui/common/task_log.py @@ -7,8 +7,7 @@ from scaler.protocol.python.common import TaskState from scaler.protocol.python.message import StateTask, StateWorker -from scaler.ui.common.utility import COMPLETED_TASK_STATUSES, display_capabilities -from scaler.ui.util import NICEGUI_MAJOR_VERSION +from scaler.ui.common.utility import COMPLETED_TASK_STATUSES, NICEGUI_MAJOR_VERSION, display_capabilities from scaler.utility.formatter import format_bytes from scaler.utility.metadata.profile_result import ProfileResult diff --git a/src/scaler/ui/common/utility.py b/src/scaler/ui/common/utility.py index 72f9b1afc..83a524b9b 100644 --- a/src/scaler/ui/common/utility.py +++ b/src/scaler/ui/common/utility.py @@ -1,9 +1,16 @@ import datetime -from typing import List, Set, Tuple +from importlib.metadata import PackageNotFoundError, version +from typing import Final, List, Set, Tuple from scaler.protocol.python.common import TaskState from scaler.ui.common.setting_page import Settings +try: + _nicegui_major_version = int(version("nicegui").split(".")[0]) +except PackageNotFoundError: + _nicegui_major_version = 0 +NICEGUI_MAJOR_VERSION: Final[int] = _nicegui_major_version + COMPLETED_TASK_STATUSES = { TaskState.Success, TaskState.Canceled, diff --git a/src/scaler/ui/webui.py b/src/scaler/ui/webui.py index eaedf486e..9d29c5215 100644 --- a/src/scaler/ui/webui.py +++ b/src/scaler/ui/webui.py @@ -1,7 +1,7 @@ import logging from scaler.config.section.webui import WebUIConfig -from scaler.ui.util import NICEGUI_MAJOR_VERSION +from scaler.ui.common.utility import NICEGUI_MAJOR_VERSION from scaler.utility.logging.utility import setup_logger