Skip to content

Fix #1342: [Bug] v2.0.10 依赖冲突: numpy/scipy/chonkie 版本不兼容#1971

Open
Memtensor-AI wants to merge 1 commit into
dev-20260624-v2.0.22from
bugfix/autodev-1342
Open

Fix #1342: [Bug] v2.0.10 依赖冲突: numpy/scipy/chonkie 版本不兼容#1971
Memtensor-AI wants to merge 1 commit into
dev-20260624-v2.0.22from
bugfix/autodev-1342

Conversation

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Description

Summary

Fixes #1342: numpy / scipy / chonkie version conflict.

Root cause. pyproject.toml [tool.poetry.group.eval] declared scipy = "^1.10.1". scipy 1.10.x pins numpy<1.27.0 (verified via the PyPI JSON metadata), while chonkie>=1.6.0 requires numpy>=2.0.0. The two constraints are jointly unsatisfiable, so any environment that ends up with both packages (the user's reproduction installs chonkie on top of an apt-installed scipy 1.10.x) raises ImportError: numpy.core.multiarray failed to import.

Fix. Bumped the eval-group scipy floor from ^1.10.1 to ^1.13.0 (scipy 1.13 is the first release supporting numpy 2.x) and added two explanatory comments — one near the bumped floor and one above the chonkie entry in the mem-reader extras — so future readers see the numpy 2.x implication.

Scope. scipy is only imported by evaluation/scripts/longmemeval/lme_eval.py and evaluation/scripts/locomo/locomo_eval.py; nothing under src/memos/ references it (grep clean). The change is therefore constraint-only, no source code path is affected.

Verification. ruff check pyproject.toml → "All checks passed!"; ruff format --check pyproject.toml → no diff; pytest tests/chunkers/ → 3 passed in 4.26s; TOML reparsed via tomli.load reports eval scipy= ^1.13.0. The committed poetry.lock already resolves scipy to 1.15.3 / 1.16.0 and numpy to 2.2.6 / 2.3.1, all of which satisfy the new ^1.13.0 floor, so a re-lock would be a no-op and is deferred to the pre-commit poetry-lock hook on the maintainer's machine.

Related Issue (Required): Fixes #1342

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Automated tests are pending.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller please review this PR.

Reviewer Checklist

…bility

The [tool.poetry.group.eval] block declared `scipy = "^1.10.1"`, but
scipy 1.10.x pins `numpy<1.27.0` while chonkie>=1.6 requires
`numpy>=2.0.0`. The two constraints cannot be jointly satisfied, so
users hitting both packages saw the
`ImportError: numpy.core.multiarray failed to import` reported in #1342.

scipy 1.13.0 is the first release that supports numpy 2.x, so this
commit:

- Bumps the eval-group scipy floor `^1.10.1` -> `^1.13.0`.
- Adds an explanatory comment near the chonkie entry in `mem-reader`
  extras so future readers see the numpy 2.x implication.

scipy is only imported by `evaluation/scripts/{longmemeval,locomo}_eval.py`;
no `src/memos/` code path is affected. The committed `poetry.lock`
already resolves scipy to 1.15.3 / 1.16.0 (numpy 2.2.6 / 2.3.1), all of
which satisfy the new floor, so no re-lock is needed.

Fixes #1342
@Memtensor-AI

Copy link
Copy Markdown
Collaborator Author

❌ Automated Test Results: FAILED

Auto-fix retry 1/2 triggered.

Failed tests:

  • test_out_of_range_rejected_or_clamped_to_valid[negative_1]
  • test_out_of_range_rejected_or_clamped_to_valid[negative_60s]
  • test_out_of_range_rejected_or_clamped_to_valid[negative_one_day]
  • test_out_of_range_rejected_or_clamped_to_valid[max_plus_1]
  • test_out_of_range_rejected_or_clamped_to_valid[max_plus_one_day]
  • test_out_of_range_rejected_or_clamped_to_valid[hundred_x_max]
  • test_invalid_type_does_not_crash_or_corrupt[string_number]
  • test_invalid_type_does_not_crash_or_corrupt[string_text]
  • test_invalid_type_does_not_crash_or_corrupt[none_value]
  • test_invalid_type_does_not_crash_or_corrupt[dict_value]
Error details
The vector_scan_max_age field on the memos config endpoint does not validate or clamp values: negative numbers, values exceeding the max, and non-numeric types (strings, None, dicts) are all persisted verbatim and returned by GET, violating the documented [0, 31536000000] integer/float contract.

Branch: bugfix/autodev-1342

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

Labels

ai-generated bug Something isn't working | 功能异常

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants