Skip to content

chore: tighten chromadb version range and add py.typed marker#142

Merged
bensig merged 2 commits intoMemPalace:mainfrom
igorls:chore/packaging-cleanup
Apr 7, 2026
Merged

chore: tighten chromadb version range and add py.typed marker#142
bensig merged 2 commits intoMemPalace:mainfrom
igorls:chore/packaging-cleanup

Conversation

@igorls
Copy link
Copy Markdown
Member

@igorls igorls commented Apr 7, 2026

Changes

1. Tighten chromadb version range (#10 — HIGH)

-"chromadb>=0.4.0,<1"
+"chromadb>=0.5.0,<0.7"

The collection API changed significantly across major versions. This pins to the tested, compatible range (tested with 0.6.3).

2. Declare optional spellcheck dependency (#30 — LOW)

[project.optional-dependencies]
spellcheck = ["autocorrect>=2.0"]

mempalace/spellcheck.py imports autocorrect but it was never declared as a dependency. Now installable via pip install mempalace[spellcheck].

3. Add PEP 561 py.typed marker (#32 — LOW)

Empty mempalace/py.typed file so type checkers (mypy, pyright) discover the package's inline type annotations.

92 tests pass (includes test infrastructure from PR #131).

Copilot AI review requested due to automatic review settings April 7, 2026 20:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates MemPalace packaging/dependencies and adds a PEP 561 marker so type checkers can discover inline annotations.

Changes:

  • Tightens the chromadb dependency range and modernizes packaging metadata (hatchling, dependency groups, optional deps).
  • Adds mempalace/py.typed (PEP 561) and aligns __version__ with the project version.
  • Adds a new test suite with shared fixtures covering search, MCP server tooling/dispatch, knowledge graph, and dialect.

Reviewed changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Pins chromadb range; adds optional spellcheck extra; switches build backend to hatchling / dependency-groups.
requirements.txt Removed legacy requirements file.
mempalace/__init__.py Updates __version__ to 3.0.0.
mempalace/py.typed Adds PEP 561 marker file.
tests/conftest.py Adds fixtures and HOME isolation for safe, hermetic tests.
tests/test_searcher.py Adds tests for programmatic search_memories.
tests/test_mcp_server.py Adds tests for MCP JSON-RPC dispatch and tool handlers.
tests/test_knowledge_graph.py Adds tests for KnowledgeGraph CRUD + temporal querying.
tests/test_dialect.py Adds tests for AAAK dialect compression/encoding/decoding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment on lines +44 to +52
[dependency-groups]
dev = ["pytest>=7.0", "ruff>=0.4.0"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["mempalace"]
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title/description focus on tightening the chromadb range and adding a py.typed marker, but this change also switches the build backend to hatchling and adds dependency-groups. Please update the PR description (or split the packaging/build-system change into a separate PR) so reviewers can evaluate the extra release-impacting changes explicitly.

Copilot uses AI. Check for mistakes.
Comment thread tests/conftest.py Outdated


@pytest.fixture(scope="session", autouse=True)
def _isolate_home(tmp_path_factory):
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The session-scoped autouse fixture _isolate_home accepts tmp_path_factory but never uses it. This adds noise and can trip unused-argument linters; consider removing the parameter (or use tmp_path_factory to create the session temp dir instead of tempfile.mkdtemp).

Suggested change
def _isolate_home(tmp_path_factory):
def _isolate_home():

Copilot uses AI. Check for mistakes.
Comment thread mempalace/__init__.py
Comment on lines 1 to 5
"""MemPalace — Give your AI a memory. No API key required."""

__version__ = "2.0.0"
__version__ = "3.0.0"

from .cli import main
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping __version__ to 3.0.0 makes the MCP initialize response version inconsistent: mempalace/mcp_server.py currently returns serverInfo.version as the hard-coded string "2.0.0". Consider deriving the MCP serverInfo version from mempalace.__version__ (and updating tests to assert the version) so clients don’t see conflicting version information.

Copilot uses AI. Check for mistakes.
Comment thread pyproject.toml
Comment on lines 27 to 30
dependencies = [
"chromadb>=0.4.0,<1",
"chromadb>=0.5.0,<0.7",
"pyyaml>=6.0",
]
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirements.txt is removed in this PR, but the CI workflow still runs pip install -r requirements.txt pytest (see .github/workflows/ci.yml). Unless the workflow is updated to install from pyproject.toml (e.g., pip install -e . plus test deps, or uv sync), CI will fail with a missing file error.

Copilot uses AI. Check for mistakes.
@bensig
Copy link
Copy Markdown
Collaborator

bensig commented Apr 7, 2026

Hey Igor — CI is failing, looks like it needs a rebase on main (we've merged a bunch of changes recently). Can you rebase and push?

- Tighten chromadb dependency from >=0.4.0,<1 to >=0.5.0,<0.7
  (the collection API changed significantly across majors; this
  pins to the tested range)
- Add optional 'spellcheck' extras for the undeclared autocorrect
  dependency used in spellcheck.py
- Add PEP 561 py.typed marker for type checker support

Findings: MemPalace#10 (HIGH — chromadb range too wide), MemPalace#30 (LOW — undeclared
          autocorrect), MemPalace#32 (LOW — missing py.typed)

Includes test infrastructure from PR MemPalace#131.
92 tests pass.
@igorls igorls force-pushed the chore/packaging-cleanup branch from 0727744 to 541e9bd Compare April 7, 2026 21:52
@igorls igorls closed this Apr 7, 2026
@igorls igorls force-pushed the chore/packaging-cleanup branch from 541e9bd to 45c2c92 Compare April 7, 2026 21:57
@igorls igorls reopened this Apr 7, 2026
@bensig bensig merged commit 71736a3 into MemPalace:main Apr 7, 2026
8 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.

3 participants