pyproject.toml had no dev/test dependency group at all, so pytest wasn't
declared anywhere — installing strictly per pyproject.toml (poetry install,
or pip install . in a clean env) left `pytest tests/` failing with
ModuleNotFoundError. Added [tool.poetry.group.dev.dependencies].
pytest-asyncio, though installed locally, isn't actually required: no test
in this suite uses `async def test_...` / @pytest.mark.asyncio, they all
drive async code via plain asyncio.run() inside sync test functions — so
only pytest itself is declared.
Verified: `poetry check` accepts the new section (only pre-existing,
unrelated [tool.poetry] vs [project] deprecation warnings); `python -m build`
still succeeds; the built wheel's METADATA does not list pytest as a runtime
dependency (dev group is correctly excluded from the published package).
Claude-Session: https://claude.ai/code/session_01Kx5DgKbhK1N8autqXH8SmS
pageindex/config.py imports `from pydantic import BaseModel` in production
code, but pyproject.toml only pulled pydantic in transitively via litellm.
A future litellm release could drop or re-pin pydantic and break installs.
Pin to `>=2.5.0,<3.0.0` to match the v2-style BaseModel usage already in the
codebase, and to stay compatible with litellm's own pydantic constraint.
* feat:compatible with Pageindex SDK
* corner cases fixed
* fix: mock behavior of old SDK
* fix: close streaming response and warn on empty api_key
- LegacyCloudAPI: close response in `finally` for both _stream_chat_response
variants so abandoned iterators no longer leak the TCP connection.
- PageIndexClient: emit a warning instead of silently falling back to local
when api_key is the empty string, surfacing typical env-var-unset misconfig.
- FakeResponse: add close()/closed to match the real requests.Response API.
- Add unit coverage for stream close (both paths) and the empty-api_key warning.
- Add scripts/e2e_legacy_sdk.py to smoke-test the legacy SDK contract end-to-end
against api.pageindex.ai.
* chore: mark legacy SDK methods with @deprecated and docstring pointers
- Decorate the 12 PageIndexClient cloud-SDK compat methods with
@typing_extensions.deprecated(..., category=PendingDeprecationWarning):
- IDE/type-checkers render them with a strikethrough hint
- runtime warnings stay silent by default (no spam for existing callers),
surfaceable via `python -W default::PendingDeprecationWarning`
- Add a one-line docstring on each pointing to the Collection-based equivalent.
- Promote typing-extensions to a direct dependency (was transitive via litellm).
---------
Co-authored-by: XinyanZhou <xinyanzhou@XinyanZhoudeMacBook-Pro.local>
Co-authored-by: saccharin98 <xinyanzhou938@gmail.com>
Co-authored-by: mountain <kose2livs@gmail.com>