Skip to content

Restructure as code_memory package and bump to 1.0.32#9

Merged
kapillamba4 merged 3 commits into
mainfrom
refactor/code-memory-package
May 11, 2026
Merged

Restructure as code_memory package and bump to 1.0.32#9
kapillamba4 merged 3 commits into
mainfrom
refactor/code-memory-package

Conversation

@kapillamba4
Copy link
Copy Markdown
Owner

@kapillamba4 kapillamba4 commented May 11, 2026

Summary

  • Move sources into a code_memory/ package so pip install code-memory stops shipping top-level modules (db, parser, queries, etc.) into users' site-packages. Intra-package imports become relative; tests use absolute from code_memory import .... Removes sys.path hacks from tests/conftest.py and tests/test_dead_code.py.
  • Delete unused test_pydantic.py debug script that previously shipped in the wheel.
  • Fix author name typo (Lambert → Lamba) in pyproject.toml.
  • Expand CI mypy from 3 files to the whole code_memory package, with per-module ignore_errors overrides for 4 modules pending type cleanup (db, doc_parser, git_search, parser).
  • Expand CI test matrix to ubuntu-latest, macos-latest, and windows-latest runners with fail-fast: false.
  • Extract _hint_if_unindexed helper in code_memory/server.py and remove all 6 stale # type: ignore[typeddict-unknown-key] annotations (the hint field is already declared as NotRequired in api_types).
  • Bump version 1.0.31 → 1.0.32 in pyproject.toml, server.json (×2), and uv.lock.

Test plan

  • uv run ruff check . — clean
  • uv run mypy code_memory — clean (11 source files)
  • uv run pytest tests/ — 140 passed
  • uv run python -c "from code_memory import server, db, parser, queries, api_types, errors, validation, doc_parser, git_search, logging_config" — all modules import
  • Verify CI green across ubuntu/macos/windows after merge
  • Smoke-test uvx code-memory from a fresh install once published

🤖 Generated with Claude Code

kapillamba4 and others added 3 commits May 11, 2026 18:18
- Move sources into a `code_memory/` package so `pip install code-memory`
  stops shipping top-level modules (`db`, `parser`, `queries`, etc.) into
  users' site-packages. Convert intra-package imports to relative; tests
  now use absolute `from code_memory import ...`. Remove sys.path hacks
  from conftest.py and test_dead_code.py.
- Delete unused test_pydantic.py debug script that previously shipped in
  the wheel.
- Fix author name typo (Lambert -> Lamba) in pyproject.toml.
- Expand CI mypy from 3 files to the whole `code_memory` package, with
  per-module `ignore_errors` overrides for 4 modules pending type cleanup
  (db, doc_parser, git_search, parser).
- Expand CI test matrix to ubuntu, macos, and windows runners with
  fail-fast disabled.
- Extract `_hint_if_unindexed` helper in server.py and remove all 6 stale
  `# type: ignore[typeddict-unknown-key]` annotations (the `hint` field
  is already declared as NotRequired in api_types).
- Bump version 1.0.31 -> 1.0.32 in pyproject.toml, server.json (x2), uv.lock.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`validate_directory`/`validate_file` resolve symlinks (intentional —
collapses `..` and normalises). On macOS, `/tmp` is a symlink to
`/private/tmp`, so the resolved result diverges from the unresolved
tempdir path. Compare against `.resolve()` instead.

Surfaced by the new ubuntu/macos/windows CI matrix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`get_db()` opens a sqlite3 connection but tools (e.g. find_dead_code)
don't explicitly close it. On Linux/macOS this is harmless since the
OS happily unlinks open files, but on Windows the .db file stays
locked until the Connection is GC'd, which can outlive the fixture
and break `TemporaryDirectory.cleanup()`.

Pass `ignore_cleanup_errors=True` so the teardown is best-effort.
Fixing the underlying connection leak is a separate concern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kapillamba4 kapillamba4 merged commit 563788a into main May 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant