Skip to content

docs: add Python 3.13 and 3.14 classifiers#302

Open
Milofax wants to merge 1 commit intoMemPalace:developfrom
Milofax:fix/chromadb-py314-compat
Open

docs: add Python 3.13 and 3.14 classifiers#302
Milofax wants to merge 1 commit intoMemPalace:developfrom
Milofax:fix/chromadb-py314-compat

Conversation

@Milofax
Copy link
Copy Markdown

@Milofax Milofax commented Apr 8, 2026

Summary

Widens chromadb dependency from >=0.5.0,<0.7 to >=0.5.0,<2.0 in pyproject.toml (and syncs README.md), fixing the crash on Python 3.14.

Problem

chromadb <0.7 uses pydantic.v1.BaseSettings which fails on Python 3.14+:

pydantic.v1.errors.ConfigError: unable to infer type for attribute "chroma_server_nofile"

Python 3.14 dropped backward-compat for pydantic-v1's type inference, making any chromadb version that imports from pydantic.v1 import BaseSettings unusable.

Fix

chromadb 1.x removed the pydantic-v1 dependency entirely. Widening the upper bound to <2.0 lets pip resolve to chromadb 1.5.7+ on Python 3.14 while keeping 0.5.x/0.6.x valid for older Python installs.

One-line change in pyproject.toml, plus README alignment.

Verification

Check Result
chromadb.PersistentClient smoke test on 3.14
pytest tests/ -x (117 tests) with chromadb 1.5.7 on Python 3.14.2 117/117 passed
No API changes needed in mempalace source

Refs: #100

@bgauryy
Copy link
Copy Markdown

bgauryy commented Apr 8, 2026

PR Review: fix: widen chromadb constraint to support Python 3.14

Executive Summary

Aspect Value
PR Goal Widen chromadb version constraint from <0.7 to <2.0 to fix Python 3.14 crash caused by pydantic-v1 incompatibility in older chromadb
Files Changed 2 (pyproject.toml, README.md)
Risk Level 🟢 LOW - minimal change, stable API surface, semver-protected upper bound
Review Effort 1/5 - trivial two-line dependency bump
Recommendation ✅ APPROVE

Affected Areas: Dependency management (pyproject.toml), documentation (README.md)

Business Impact: Unblocks installation on Python 3.14+. Without this fix, pip install mempalace crashes on 3.14 because the resolved chromadb (<0.7) pulls in pydantic.v1.BaseSettings which Python 3.14 no longer supports.

Flow Changes: None — no code changes, only dependency metadata.

Ratings

Aspect Score
Correctness 5/5
Security 5/5
Performance 5/5
Maintainability 4/5

PR Health

  • Has clear description
  • References root cause (pydantic.v1.errors.ConfigError)
  • Appropriate size (2 files, 2 additions / 2 deletions)
  • Has relevant tests — N/A for dependency constraint change; CI pipeline should validate

Chromadb API Compatibility Analysis

The codebase uses chromadb exclusively through palace_db.py (as mandated by project rules). The API surface is minimal and stable across 0.5→1.x:

API Used Location Stable Since Status in 1.5.7
chromadb.PersistentClient(path=) palace_db.py:19 0.4.x ✅ Stable
client.get_or_create_collection(name) palace_db.py:36 0.4.x ✅ Stable
client.get_collection(name) palace_db.py:38 0.4.x ✅ Stable
collection.get(where=, limit=) palace_db.py:58 0.4.x ✅ Stable
collection.query(query_texts=, n_results=, include=, where=) palace_db.py:88-92 0.4.x ✅ Stable

Conclusion: All five API calls are core stable operations. No breaking change risk for the version window >=0.5.0,<2.0.

Medium Priority Issues

🎨 #1: README lower bound was stale — now fixed but inconsistent with pyproject.toml history

Location: README.md:690 | Confidence: ⚠️ MED

The README previously stated chromadb>=0.4.0 (no upper bound) while pyproject.toml had >=0.5.0,<0.7. This PR correctly syncs both to >=0.5.0,<2.0. Worth noting the README lower bound was bumped from 0.4.00.5.0 as part of this PR — this is correct since chromadb 0.4.x is very old and the PersistentClient API solidified in 0.5.x.

No action needed — this is a positive cleanup.

Low Priority Issues

🏗️ #2: Consider whether <2.0 is too wide a constraint

Location: pyproject.toml:28 | Confidence: ❓ LOW

The jump from <0.7 to <2.0 is a large window. Chromadb 2.0 (when released) may include breaking changes per semver. Current latest is 1.5.7 (published 2026-04-08).

Counterargument: The <2.0 constraint is standard practice for major-version pinning in Python packaging (similar to requests>=2.0,<3.0). Since chromadb follows semver, 1.x→2.0 is exactly the boundary where breaking changes are expected. This is the correct upper bound.

Verdict: No change needed — <2.0 is the idiomatic Python constraint for this situation.

🔗 #3: No Python 3.14 classifier in pyproject.toml

Location: pyproject.toml:22-27 | Confidence: ❓ LOW

The classifiers list Python 3.9–3.12 but doesn't include 3.13 or 3.14. Since this PR's purpose is to support Python 3.14, adding the classifier would signal that intent:

     "Programming Language :: Python :: 3.12",
+    "Programming Language :: Python :: 3.13",
+    "Programming Language :: Python :: 3.14",

This is cosmetic metadata only — not blocking.


Flow Impact Analysis

No flow impact. This PR changes only dependency metadata; no source code is modified. The chromadb API surface used by mempalace remains identical.

Before: pip resolves chromadb to 0.5.x-0.6.x → fails on Python 3.14 (pydantic.v1 crash)
After:  pip resolves chromadb to 1.5.7      → works on Python 3.14

Created by Octocode MCP https://octocode.ai

Milofax added a commit to Milofax/mempalace that referenced this pull request Apr 9, 2026
Follow up on PR MemPalace#302 by declaring the Python versions the project now
supports after widening the chromadb constraint for Python 3.14.

This is metadata only; test suite remains green on Python 3.14.2.
Perseusxrltd added a commit to Perseusxrltd/mnemion that referenced this pull request Apr 9, 2026
- pyproject.toml: widen chromadb to <2.0 for Python 3.14 compat (MemPalace#302)
- config.py + miner/convo_miner/mcp_server: add hnsw:space=cosine so
  similarity = 1 - distance stays in [0,1] instead of negative L2 (MemPalace#304)
- searcher.py + layers.py: guard against ChromaDB 1.x empty-outer query
  results (IndexError on fresh collections) (MemPalace#305)
- mcp_server.py: redirect stdout→stderr at import to protect JSON-RPC
  wire from chromadb/posthog chatter (MemPalace#306)
- mcp_server.py: replace 10k-limited col.get with paginating
  _iter_all_metadatas helper; stop swallowing errors silently (MemPalace#307)
- mcp_server.py: drop undocumented wait_for_previous arg injected by
  Gemini MCP clients (MemPalace#322)
- searcher.py + hybrid_searcher.py + mcp_server.py: add min_similarity
  threshold filter so callers get a clean "no results" signal (MemPalace#350)
- entity_detector.py: add CODE_KEYWORDS blocklist (~80 terms) to stop
  Rust types / React / framework names being detected as entities (MemPalace#349)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@web3guru888 web3guru888 left a comment

Choose a reason for hiding this comment

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

I appreciate the intent — Python 3.14 support is important for forward-compat — but the constraint change from <0.7 to <2.0 is quite wide and may cause issues.

The problem with <2.0: ChromaDB has had breaking API changes between minor versions (the 0.4→0.5 migration broke collection APIs, and 0.5→0.6 changed embedding function defaults). Opening the upper bound to <2.0 means users could install a future ChromaDB version that breaks MemPalace's col.get(), col.query(), or col.add() calls without any error at install time. The breakage would surface at runtime as confusing exceptions.

What we do: We pin chromadb>=0.6.0,<0.7.0 in our integration. This gives us the latest patches while protecting against API breaks. We've been burned by the version drift before — it's a major community pain point (see #426, #445, #457, #458).

Suggestion: A safer approach might be chromadb>=0.5.0,<0.8 or even <1.0 — still gives plenty of room for 3.14 compat without opening up to a hypothetical 1.x that could have major API changes. Alternatively, the Python 3.14 compat issue might be better solved by testing against chromadb's latest 0.6.x build on 3.14 and updating the classifiers separately from the version constraint.

Also: the README says chromadb>=0.4.0 but pyproject.toml had >=0.5.0 — this PR updates the README to >=0.5.0 which is the correct alignment, so that part is good.

🔭 Reviewed as part of the MemPalace-AGI integration project — autonomous research with perfect memory. Community interaction updates are posted regularly on the dashboard.

Copy link
Copy Markdown
Collaborator

@bensig bensig left a comment

Choose a reason for hiding this comment

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

Code review + security audit clean.

@bensig
Copy link
Copy Markdown
Collaborator

bensig commented Apr 12, 2026

hey @Milofax — this conflicts with develop now. could you pls rebase? the fix itself looks good, just needs a fresh merge. thanks!

@igorls igorls added area/install pip/uv/pipx/plugin install and packaging bug Something isn't working labels Apr 14, 2026
Follow up on PR MemPalace#302 by declaring the Python versions the project now
supports after widening the chromadb constraint for Python 3.14.

This is metadata only; test suite remains green on Python 3.14.2.
@Milofax Milofax force-pushed the fix/chromadb-py314-compat branch from 801db99 to 1891b1b Compare April 15, 2026 09:26
@Milofax Milofax changed the title fix: widen chromadb constraint to support Python 3.14 docs: add Python 3.13 and 3.14 classifiers Apr 15, 2026
@Milofax
Copy link
Copy Markdown
Author

Milofax commented Apr 15, 2026

rebased onto develop. the chromadb commit dropped since develop already widened the constraint further (removed upper bound entirely). this PR now only adds the 3.13/3.14 classifiers — retitled accordingly. let me know if you'd rather close this and have the classifier bump elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install pip/uv/pipx/plugin install and packaging bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants