Restructure as code_memory package and bump to 1.0.32#9
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
code_memory/package sopip install code-memorystops shipping top-level modules (db,parser,queries, etc.) into users' site-packages. Intra-package imports become relative; tests use absolutefrom code_memory import .... Removessys.pathhacks fromtests/conftest.pyandtests/test_dead_code.py.test_pydantic.pydebug script that previously shipped in the wheel.pyproject.toml.mypyfrom 3 files to the wholecode_memorypackage, with per-moduleignore_errorsoverrides for 4 modules pending type cleanup (db,doc_parser,git_search,parser).ubuntu-latest,macos-latest, andwindows-latestrunners withfail-fast: false._hint_if_unindexedhelper incode_memory/server.pyand remove all 6 stale# type: ignore[typeddict-unknown-key]annotations (thehintfield is already declared asNotRequiredinapi_types).pyproject.toml,server.json(×2), anduv.lock.Test plan
uv run ruff check .— cleanuv run mypy code_memory— clean (11 source files)uv run pytest tests/— 140 passeduv run python -c "from code_memory import server, db, parser, queries, api_types, errors, validation, doc_parser, git_search, logging_config"— all modules importuvx code-memoryfrom a fresh install once published🤖 Generated with Claude Code