Require typing_extensions with Self support on Python 3.10 - #233
Doribelove wants to merge 1 commit into
Conversation
Python 3.10 imports Self from typing_extensions. Require the first release that provides it so dependency resolution cannot silently install an incompatible older version. Assisted-by: OpenAI Codex Signed-off-by: 李永祺 <doribelove@gmail.com>
|
Thank you for tracking this down — #78 has been open since May 2023 with the root cause already correctly diagnosed in the comments, but nobody ever followed through with a fix. Nice to see it closed out. I reproduced it independently before approving: a genuinely isolated Python 3.10 venv, For reference, this doesn't overlap with #212 (which collapses the per-Python-version type shim into one file) — that PR keeps the same unconditional Approving — thanks for the fix. |
Summary
On Python 3.10,
spatialmath.base._types_39importsSelffromtyping_extensions. The current unbounded dependency allowstyping_extensions==3.10.0.2, which lacksSelfand makesimport spatialmathfail. Requiretyping_extensions>=4.0.0, the first release withSelf, so the package metadata reflects this import requirement.Validation
typing_extensions==3.10.0.2, reproducedImportError: cannot import name 'Self' from 'typing_extensions'before the metadata change.typing_extensionsto 4.16.0 andimport spatialmathsucceeded.import spatialmathsucceeds with the minimum allowed version, 4.0.0.pytest -q --disable-warnings: 347 passed, 3 skipped (Python 3.10.12);git diff --checkpassed.Fixes #78. Prepared and validated with OpenAI Codex assistance.