Skip to content

Commit f9aed39

Browse files
jonpspriclaude
andauthored
fix: resolve circular imports and update configuration for v0.0.3 (#107)
* fix: resolve circular imports and update documentation - Fix critical circular import between session.py and session_service.py using lazy imports - Convert all relative imports to absolute imports to resolve TID252 violations - Update MyPy configuration with mypy_path="src" for pre-commit compatibility - Update all documentation to use consistent `uv run --directory src mypy .` syntax - Streamline test-coverage-analyzer agent description to focus on prescriptive guidance This resolves all blocking issues for v0.0.3 release: - Package imports successfully without circular dependency errors - All ruff violations resolved (15 TID252 fixes) - MyPy passes with zero errors from project root - Pre-commit pipeline passes completely 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: update CHANGELOG for v0.0.3 release - Add comprehensive changelog entry for v0.0.3 - Document circular import resolution and import architecture fixes - Note MyPy configuration improvements and documentation consistency updates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 096f1b2 commit f9aed39

20 files changed

Lines changed: 111 additions & 300 deletions

.claude/agents/python-type-optimizer.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ uv run rg ".*: dict\[str, Any\]" src/databeak/ --type py -A 2 -B 1
168168

169169
```bash
170170
# Check current type issues
171-
uv run mypy src/databeak/ | grep -i "any"
171+
uv run --directory src mypy databeak/ | grep -i "any"
172172
```
173173

174174
### Step 3: Create Central Type Definitions
@@ -345,7 +345,7 @@ class DataBeakErrorInfo(TypedDict):
345345

346346
```bash
347347
# Check type improvements don't break existing code
348-
uv run mypy src/databeak/ --strict
348+
uv run --directory src mypy databeak/ --strict
349349

350350
# Ensure no new Any usage introduced
351351
uv run rg "Any" src/databeak/ --type py | wc -l
@@ -354,7 +354,7 @@ uv run rg "Any" src/databeak/ --type py | wc -l
354354
uv run pytest -n auto tests/ -v
355355

356356
# Full quality check
357-
uv run ruff check src/ tests/ && uv run ruff format --check src/ tests/ && uv run mypy src/ && uv run pytest -n auto
357+
uv run ruff check src/ tests/ && uv run ruff format --check src/ tests/ && uv run --directory src mypy . && uv run pytest -n auto
358358
```
359359

360360
### Analysis Commands
@@ -365,7 +365,7 @@ uv run rg ": Any" src/databeak/ --count-matches
365365
uv run rg "dict\[str, Any\]" src/databeak/ --count-matches
366366

367367
# Check for new type issues
368-
uv run mypy src/databeak/ | grep -c "error:"
368+
uv run --directory src mypy databeak/ | grep -c "error:"
369369
```
370370

371371
## Success Criteria

.claude/agents/quality-gate-runner.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ uv run ruff check src/ tests/
6565
uv run ruff format --check src/ tests/
6666

6767
# 4. Type checking
68-
uv run mypy src/
68+
uv run --directory src mypy .
6969

7070
# 5. MCP documentation compliance
7171
scripts/check_docstring_args.py # Ensure no Args sections in MCP tools
@@ -149,7 +149,8 @@ mypy.....................................................................Failed
149149

150150
**Use individual tools when:**
151151

152-
- Debugging specific issues (e.g., `uv run mypy src/databeak/analytics.py`)
152+
- Debugging specific issues (e.g.,
153+
`uv run --directory src mypy databeak/analytics.py`)
153154
- Testing fixes for specific tool failures
154155
- Need detailed output format (e.g., JSON for parsing)
155156

@@ -267,7 +268,7 @@ uv run ruff check src/ tests/ --output-format=json
267268
uv run ruff format --check src/ tests/
268269

269270
# Type checking (collect all MyPy errors)
270-
uv run mypy src/ --error-format=json
271+
uv run --directory src mypy . --error-format=json
271272

272273
# Testing with coverage
273274
uv run pytest -n auto tests/ --cov=src --cov-report=json --cov-report=term-missing
@@ -355,7 +356,7 @@ uv run ruff check --fix --select I src/ tests/
355356
# For coverage gaps - suggest specific test scenarios
356357

357358
# After fixes, re-run specific checks
358-
uv run mypy src/databeak/tools/analytics.py # Target specific file
359+
uv run --directory src mypy databeak/tools/analytics.py # Target specific file
359360
uv run pytest tests/test_io_operations.py -v # Target specific test (single test, no parallel)
360361
```
361362

0 commit comments

Comments
 (0)