Skip to content

fix(deps): relax tokenizers floor to >=0.22 so [rerank] install resolves (closes #333) - #334

Merged
jphein merged 1 commit into
mainfrom
fix/333-tokenizers-bound
May 31, 2026
Merged

fix(deps): relax tokenizers floor to >=0.22 so [rerank] install resolves (closes #333)#334
jphein merged 1 commit into
mainfrom
fix/333-tokenizers-bound

Conversation

@jphein

@jphein jphein commented May 30, 2026

Copy link
Copy Markdown
Collaborator

The bug

A fresh pip install mempalace[rerank] fails:

ERROR: Cannot install mempalace and mempalace[rerank]==3.3.6 because these
package versions have conflicting dependencies.
ERROR: ResolutionImpossible

Root cause (verified, not guessed)

The [rerank] extra pulls sentence-transformerstransformers, whose current releases pin tokenizers>=0.22.0,<=0.23.0 (confirmed from the published wheel metadata of transformers 5.9.0). mempalace core declares tokenizers>=0.23 — a floor above the bottom of that window. The only version satisfying both is the single point 0.23.0; pip can't hold that against the rest of the rerank tree (torch, scikit-learn, regex pins) and backtracks through dozens of transformers versions before failing.

Fix

Relax the core floor to tokenizers>=0.22,<0.24:

  • 0.22 is the actual bottom of the transformers window — and what the stack resolves to in practice: tokenizers 0.22.2 + transformers 5.9.0 + sentence-transformers 5.5.1.
  • mempalace's only direct use is mempalace/embedding.py (from tokenizers import TokenizerTokenizer.from_file), a stable API well below 0.22, so lowering the floor is safe.
  • <0.24 keeps it bounded.

Verification

  • Reproduced the conflict in a fresh venv on the pre-fix bound (ResolutionImpossible).
  • After fix, fresh pip install mempalace[rerank] resolves cleanly; import mempalace, the embedding.py Tokenizer path, and sentence_transformers.CrossEncoder / mempalace.cross_encoder_rerank all import.
  • Full suite: 3792 passed, 61 skipped (pytest tests/); ruff check + ruff format --check clean.

Note on uv.lock

The mempalace tokenizers specifier in uv.lock was already drifted (>=0.15) — PR #207 bumped pyproject to >=0.23 without re-locking, and CI installs via pip install -e ".[dev]" (not uv sync --locked), so the lock is a developer convenience, not a CI gate. I synced just that one specifier line to the new bound rather than regenerating the whole lock; a full uv lock is a separate ~3k-line churn (it would also pull the never-locked rerank/torch tree) best done in a dedicated housekeeping pass.

Closes #333.

🤖 Generated with Claude Code

…ves (closes #333)

A fresh `pip install mempalace[rerank]` fails with ResolutionImpossible.
Root cause: the rerank extra pulls sentence-transformers → transformers,
whose current releases pin `tokenizers>=0.22.0,<=0.23.0` (e.g.
transformers 5.9.0). mempalace's core `tokenizers>=0.23` floor sits above
the bottom of that window, leaving the resolver only the single point
0.23.0 to satisfy both constraints. pip can't hold that against the rest
of the rerank tree and backtracks through dozens of transformers versions
before failing.

Relax the floor to `tokenizers>=0.22,<0.24`. 0.22 is the actual bottom of
the transformers window and what the rerank stack resolves to (verified:
tokenizers 0.22.2 + transformers 5.9.0 + sentence-transformers 5.5.1).
mempalace's only direct use (embedding.py: `Tokenizer.from_file`) is
stable well below 0.22, so lowering the floor is safe. `<0.24` keeps it
bounded.

Verified in a fresh venv: `pip install mempalace[rerank]` now resolves
cleanly and the cross-encoder rerank path imports/loads. Full test suite
green (3792 passed), ruff clean.

uv.lock: the mempalace tokenizers specifier was already drifted to
`>=0.15` (PR #207 bumped pyproject to >=0.23 without re-locking, and CI
installs via `pip install -e ".[dev]"`, not `uv sync`, so the lock is a
dev convenience, not a gate). Synced that one specifier to the new bound
rather than regenerating the whole lock — a full `uv lock` is a separate
~3k-line churn best done in a dedicated housekeeping pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 30, 2026 22:40
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a dependency resolution failure encountered when installing the mempalace[rerank] extra. By adjusting the version constraints for the tokenizers package, the change allows the dependency resolver to successfully find a compatible version across the entire dependency tree, ensuring a smoother installation process for users.

Highlights

  • Dependency Resolution Fix: Relaxed the tokenizers dependency floor from >=0.23 to >=0.22,<0.24 to resolve installation conflicts when using the [rerank] extra.
  • Compatibility Improvement: Ensured compatibility with the transformers library versioning, preventing ResolutionImpossible errors during pip install.
Ignored Files
  • Ignored by pattern: *.lock (1)
    • uv.lock
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the dependency constraint for tokenizers in pyproject.toml from >=0.23 to >=0.22,<0.24 to resolve a dependency resolution conflict with the [rerank] extra dependencies. No review comments were provided, and the changes appear correct and well-documented.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jphein
jphein merged commit b1706ff into main May 31, 2026
9 of 10 checks passed
@jphein
jphein deleted the fix/333-tokenizers-bound branch May 31, 2026 00:36
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.

fix(deps): tokenizers>=0.23 lower bound is too tight — breaks sentence-transformers rerank install

2 participants