Skip to content

Commit a2ebe03

Browse files
committed
fix: remaining lint errors in src and tests
1 parent 18d9523 commit a2ebe03

59 files changed

Lines changed: 75 additions & 154 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/swe_forge/discovery/agentic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
import json
1414
import re
1515
from dataclasses import dataclass, field
16-
from typing import TYPE_CHECKING, Any
16+
from typing import TYPE_CHECKING
1717

1818
if TYPE_CHECKING:
1919
from swe_forge.detection.language import Language
20-
from swe_forge.detection.package_manager import PackageManager
2120
from swe_forge.swe.agentic_config import SandboxProtocol
2221
from swe_forge.llm.client import LLMClient
2322

src/swe_forge/docker_test/harness.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pathlib import Path
1515
from typing import TYPE_CHECKING, Any
1616

17-
from swe_forge.execution.docker_client import DockerClient, DockerError, ExecResult
17+
from swe_forge.execution.docker_client import DockerClient, DockerError
1818
from swe_forge.execution.sandbox import DockerSandbox, SandboxConfig
1919

2020
if TYPE_CHECKING:
@@ -112,7 +112,6 @@ async def _build_from_dockerfile(
112112
context_dir: str | Path | None = None,
113113
) -> str:
114114
"""Build image from Dockerfile string."""
115-
import tempfile
116115

117116
image_tag = f"swe-test-{uuid.uuid4().hex[:8]}"
118117

@@ -137,7 +136,7 @@ async def _build_from_dockerfile(
137136

138137
async def _build_from_workspace(self, workspace: dict[str, Any]) -> str:
139138
"""Build image from workspace configuration."""
140-
image_tag = f"swe-test-{uuid.uuid4().hex[:8]}"
139+
_image_tag = f"swe-test-{uuid.uuid4().hex[:8]}"
141140

142141
base_image = workspace.get("environment", {}).get("image", self.default_image)
143142
language = workspace.get("language", "python")

src/swe_forge/docker_test/verification.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from dataclasses import dataclass
1212
from typing import TYPE_CHECKING, Sequence
1313

14+
from swe_forge.docker_test.harness import TestRunResult
15+
1416
if TYPE_CHECKING:
1517
from swe_forge.docker_test.harness import DockerTestHarness
1618

@@ -230,10 +232,8 @@ async def _run_fail_to_pass_tests(
230232
sandbox,
231233
tests: Sequence[str],
232234
timeout: float,
233-
) -> "TestRunResult":
235+
) -> TestRunResult:
234236
"""Run fail_to_pass tests."""
235-
from swe_forge.docker_test.harness import TestRunResult
236-
237237
if not tests:
238238
return TestRunResult(
239239
passed=True,
@@ -265,7 +265,7 @@ async def _run_pass_to_pass_tests(
265265
sandbox,
266266
tests: Sequence[str],
267267
timeout: float,
268-
) -> "TestRunResult":
268+
) -> TestRunResult:
269269
"""Run pass_to_pass tests."""
270270
return await _run_fail_to_pass_tests(sandbox, tests, timeout)
271271

src/swe_forge/execution/commands.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
import json
6-
import asyncio
76
import time
87
from dataclasses import dataclass
98
from typing import TYPE_CHECKING

src/swe_forge/execution/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from __future__ import annotations
88

9-
from dataclasses import dataclass, field
9+
from dataclasses import dataclass
1010
from enum import Enum
1111
from typing import Any, TYPE_CHECKING
1212

src/swe_forge/execution/sandbox.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
ContainerManager,
2121
ContainerSpec,
2222
ManagedContainerStatus,
23-
VolumeMount,
2423
)
2524
from swe_forge.execution.docker_client import DockerClient, DockerError
2625
from swe_forge.execution.commands import exec_in_container, ExecResult
@@ -413,9 +412,9 @@ async def install_dependencies(
413412
if not packages and not requirements_file:
414413
raise ValueError("Must provide either packages or requirements_file")
415414

416-
container_id = self._require_running()
415+
_container_id = self._require_running()
417416
install_timeout = timeout or self._config.install_timeout
418-
workspace_dir = self._config.workspace_dir
417+
_workspace_dir = self._config.workspace_dir
419418

420419
if requirements_file:
421420
cmd = f"pip install -r {requirements_file}"
@@ -611,7 +610,7 @@ def image_for_language(language: str) -> str:
611610
Returns:
612611
Docker image name (generic fallback).
613612
"""
614-
language_lower = language.lower()
613+
_language_lower = language.lower()
615614

616615
# FALLBACK: Let Docker Hub resolve based on language
617616
# The agent should detect and use the correct image

src/swe_forge/export/parquet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
import json
6-
from datetime import datetime
76
from pathlib import Path
87
from typing import TYPE_CHECKING
98

src/swe_forge/llm/anthropic_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Anthropic LLM client implementation."""
22

33
import json
4-
from typing import Any, Literal
4+
from typing import Any
55

66
from anthropic import AsyncAnthropic
77

src/swe_forge/llm/openrouter.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717

1818
from swe_forge.llm.client import (
1919
Choice,
20-
Choice as ClientChoice,
2120
FunctionCall,
2221
GenerationRequest,
2322
GenerationResponse,
2423
LLMClient,
2524
Message,
2625
ToolCall,
27-
ToolDefinition,
2826
Usage,
2927
)
3028

src/swe_forge/llm/tools.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
from dataclasses import dataclass, field
1414
from typing import Any
1515

16-
from pydantic import ValidationError
1716

1817
from swe_forge.llm.client import (
19-
FunctionCall,
2018
Message,
2119
ToolCall,
2220
ToolDefinition,

0 commit comments

Comments
 (0)