Skip to content

Commit 51da5df

Browse files
committed
Fix hatchling build
1 parent 46fa5e7 commit 51da5df

File tree

7 files changed

+21
-41
lines changed

7 files changed

+21
-41
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,14 @@ jobs:
5959
version: "latest"
6060

6161
- name: Install dependencies
62-
run: uv sync --dev
62+
run: |
63+
uv venv
64+
uv pip install -e ".[dev]"
6365
6466
- name: Run tests
65-
run: uv run pytest tests/ -v --cov=src/codeoptix --cov-report=xml --cov-report=term
67+
run: |
68+
source .venv/bin/activate
69+
pytest tests/ -v --cov=src/codeoptix --cov-report=xml --cov-report=term
6670
6771
- name: Upload coverage
6872
uses: codecov/codecov-action@v4

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ docs = [
7070
"mkdocs-material>=9.4.0",
7171
"pymdown-extensions>=10.0.0",
7272
"mkdocs-minify-plugin>=0.7.0",
73-
"hatchling",
7473
]
7574
all = [
7675
"codeoptix[dev,testing,docs]",
@@ -84,8 +83,11 @@ accessibility = [
8483
codeoptix = "codeoptix.cli:main"
8584

8685
[build-system]
87-
requires = ["hatchling"]
88-
build-backend = "hatchling.build"
86+
requires = ["setuptools>=68.0", "wheel"]
87+
build-backend = "setuptools.build_meta"
88+
89+
[tool.setuptools.packages.find]
90+
where = ["src"]
8991

9092
[tool.ruff]
9193
line-length = 100

src/codeoptix/adapters/basic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, config: dict[str, Any]):
2525
raise ValueError("BasicAdapter requires 'llm_config' in configuration")
2626

2727
# Create LLM client
28-
from codeoptix.utils.llm import create_llm_client, LLMProvider
28+
from codeoptix.utils.llm import LLMProvider, create_llm_client
2929

3030
provider_name = llm_config.get("provider", "ollama")
3131
self.llm_client: LLMClient = create_llm_client(
@@ -154,10 +154,10 @@ def _parse_response(self, response: str) -> tuple[str, str]:
154154
if line_lower.startswith("code:") or "```" in line_lower:
155155
current_section = "code"
156156
continue
157-
elif line_lower.startswith("tests:") or line_lower.startswith("test:"):
157+
if line_lower.startswith(("tests:", "test:")):
158158
current_section = "tests"
159159
continue
160-
elif current_section == "code" and line.strip():
160+
if current_section == "code" and line.strip():
161161
# Remove markdown code blocks
162162
if "```" in line:
163163
continue

src/codeoptix/adapters/claude_code.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ def __init__(self, config: dict[str, Any]):
3838
provider_name = llm_config.get("provider", "anthropic").upper()
3939
try:
4040
provider = LLMProvider[provider_name]
41-
except KeyError:
42-
# Fallback to ANTHROPIC if invalid provider
43-
provider = LLMProvider.ANTHROPIC
41+
except KeyError as e:
42+
supported_providers = ", ".join([p.value for p in LLMProvider])
43+
raise ValueError(
44+
f"Invalid LLM provider '{provider_name}'. "
45+
f"Supported providers: {supported_providers}"
46+
) from e
4447

4548
# Get API key (not required for Ollama)
4649
api_key = None

tests/test_behaviors_coverage.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""Test behaviors for coverage."""
22

3-
import pytest
43

5-
from codeoptix.behaviors import create_behavior
64
from codeoptix.adapters import AgentOutput
5+
from codeoptix.behaviors import create_behavior
76

87

98
class TestBehaviorsCoverage:

tests/test_cli_commands.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Test CLI commands for coverage."""
22

3-
import pytest
43
from click.testing import CliRunner
54

65
from codeoptix.cli import main

uv.lock

Lines changed: 0 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)