fix(deps): declare typing_extensions and use stdlib NotRequired on 3.11+#693
Open
joerg84 wants to merge 2 commits into
Open
fix(deps): declare typing_extensions and use stdlib NotRequired on 3.11+#693joerg84 wants to merge 2 commits into
joerg84 wants to merge 2 commits into
Conversation
Clean installs on Python 3.13+/3.14 fail at import: indexes_helpers imports NotRequired from typing_extensions, which was never declared and only arrived transitively (httpx -> anyio, python_version < 3.13) or via dev tooling. Gate the import (stdlib typing on 3.11+), declare the backport for 3.10 only, and add 3.14 to the unit-test matrix so a clean-install regression like this cannot hide behind dev dependencies. Fixes #690 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r 3.14 Python 3.14 removed implicit event-loop creation from asyncio.get_event_loop(), so the six sync test drivers using get_event_loop().run_until_complete(...) now raise RuntimeError. asyncio.run() is a drop-in here and works across the whole support matrix. Caught by the new py3.14 CI job from this PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
|
The new py3.14 matrix job immediately caught a real 3.14 incompatibility: six test drivers used |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Clean installs on Python 3.13+/3.14 fail at
import pinecone:_internal/indexes_helpers.pyimportsNotRequiredfromtyping_extensions, which is not declared in[project] dependencies. It worked by accident —httpx → anyioonly pullstyping_extensionsonpython_version < "3.13", and dev/CI environments always carry it via mypy. The unit-test matrix capping at 3.13 completed the blind spot.Fix
typing.NotRequiredon 3.11+, backport on 3.10.typing_extensions>=4.0; python_version < '3.11'.Testing
httpx[http2],msgspec,orjsoninstalled:pinecone._internal.indexes_helpersimports cleanly (fails withModuleNotFoundErroron main).uv run pytest tests/unit: 4376 passed. (test_socket_options.pylinux/darwin keepalive tests fail identically on clean main on macOS — pre-existing, untouched.)ruff check,ruff format --check,mypy --strictclean on the touched file.Fixes #690
Found by a cold-agent audit (2/2 bare-environment trials hit this on first import).
🤖 Generated with Claude Code
Note
Low Risk
Dependency and import-path fixes with narrow typing backport scope; test-only asyncio API changes; no runtime behavior change beyond fixing missing dependency on newer Python.
Overview
Fixes clean-install import failures on Python 3.13+ where
indexes_helperspulledNotRequiredfromtyping_extensionswithout it being a declared runtime dependency.NotRequiredsourcing is version-gated inindexes_helpers.py: stdlibtypingon 3.11+,typing_extensionsonly on 3.10.pyproject.tomladdstyping_extensions>=4.0; python_version < '3.11', documents Python 3.14 in trove classifiers, and CI unit tests now include 3.14 in the matrix.Unit tests that drove async coroutines via
asyncio.get_event_loop().run_until_completenow useasyncio.run(batch and retry transport).uv.lockis refreshed (package version and dependency marker cleanup).Reviewed by Cursor Bugbot for commit 18b4ae9. Bugbot is set up for automated code reviews on this repo. Configure here.