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
20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ jobs:
if: steps.guard.outputs.ready == 'true'
working-directory: packages/adk-plugin
run: python -m pip install -e ".[dev]"
# TEMP: ruff disabled while importing transferred code (pre-existing lint debt).
# Re-enable in a later PR once the code is lint-clean (see project tasks).
# - name: Lint (ruff)
# if: steps.guard.outputs.ready == 'true'
# working-directory: packages/adk-plugin
# run: ruff check .
- name: Lint (ruff)
if: steps.guard.outputs.ready == 'true'
working-directory: packages/adk-plugin
run: ruff check .
# NOTE: this package's pytest suite is LIVE-integration (spins up real
# Daytona sandboxes, needs DAYTONA_API_KEY). It must NOT run on every PR —
# add it later as a separate opt-in (manual/scheduled) workflow.
Expand All @@ -92,12 +90,10 @@ jobs:
if: steps.guard.outputs.ready == 'true'
working-directory: packages/langchain-data-analysis
run: poetry install --with test,lint
# TEMP: ruff disabled while importing transferred code (pre-existing lint debt).
# Re-enable in a later PR once the code is lint-clean (see project tasks).
# - name: Lint (ruff)
# if: steps.guard.outputs.ready == 'true'
# working-directory: packages/langchain-data-analysis
# run: poetry run ruff check .
- name: Lint (ruff)
if: steps.guard.outputs.ready == 'true'
working-directory: packages/langchain-data-analysis
run: poetry run ruff check .
# NOTE: integration tests need live Daytona credentials — keep them out of
# PR CI; add them later as a separate opt-in workflow.

Expand Down
4 changes: 2 additions & 2 deletions packages/adk-plugin/daytona_adk/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import logging
from typing import Any, Dict, Optional

logger = logging.getLogger(__name__)

from google.adk.agents.base_agent import BaseAgent
from google.adk.agents.callback_context import CallbackContext
from google.adk.plugins import BasePlugin
Expand All @@ -25,6 +23,8 @@
StartLongRunningCommandTool,
)

logger = logging.getLogger(__name__)


class DaytonaPlugin(BasePlugin):
"""Plugin for code execution in Daytona development environments.
Expand Down
4 changes: 2 additions & 2 deletions packages/adk-plugin/daytona_adk/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import uuid
from typing import Any, Dict, Optional

logger = logging.getLogger(__name__)

from daytona import CodeRunParams, Sandbox, SessionExecuteRequest # type: ignore
from google.adk.tools import BaseTool, ToolContext
from google.genai import types

logger = logging.getLogger(__name__)


class ExecuteCodeTool(BaseTool):
"""Tool for executing code snippets inside the Daytona sandbox."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class SandboxUploadedFile(BaseModel):
remote_path: str
description: str

tool_base_description = """Tool for running python code in a sandboxed environment for data analysis. \
tool_base_description = """\
Tool for running python code in a sandboxed environment for data analysis. \
The environment is long running and exists across multiple executions. \
You must send the whole script every time and print your outputs. \
Script should be pure python code that can be evaluated. \
Expand Down Expand Up @@ -148,7 +149,9 @@ def __init__(
self._on_result = on_result

def _run(
self, data_analysis_python_code: str, run_manager: Optional[CallbackManagerForToolRun] = None,
self,
data_analysis_python_code: str,
run_manager: Optional[CallbackManagerForToolRun] = None,
) -> Union[str, ExecutionArtifacts]:
python_code_to_exec = self._add_last_line_print(data_analysis_python_code)

Expand Down
10 changes: 9 additions & 1 deletion packages/langchain-data-analysis/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@ python = ">=3.9,<4.0"
langchain-core = ">=0.3.15,<2.0.0"
daytona = "^0.194.0"

[tool.ruff]
line-length = 100

[tool.ruff.lint]
select = ["E", "F", "I", "T201"]

[tool.ruff.lint.per-file-ignores]
# Docs notebooks are illustrative: `print` output, prose comments, and unsorted
# demo imports are intentional there.
"docs/**" = ["T201", "E501", "I001"]

[tool.coverage.run]
omit = ["tests/*"]

Expand Down Expand Up @@ -69,7 +77,7 @@ codespell = "^2.2.6"
[tool.poetry.group.test_integration.dependencies]

[tool.poetry.group.lint.dependencies]
ruff = "^0.5"
ruff = "^0.15.0"

[tool.poetry.group.typing.dependencies]
mypy = "^1.10"
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def test_add_last_line_print_adds_print(self, tool: DaytonaDataAnalysisTool) ->
result = tool._add_last_line_print(code)
assert "print(x)" in result

def test_add_last_line_print_leaves_print_unchanged(self, tool: DaytonaDataAnalysisTool) -> None:
def test_add_last_line_print_leaves_print_unchanged(
self, tool: DaytonaDataAnalysisTool
) -> None:
code = "x = 5\nprint(x)"
result = tool._add_last_line_print(code)
assert result.strip().endswith("print(x)")
Loading