Commit graph

3 commits

Author SHA1 Message Date
Jeremiah Lowin
360c9c31e5
fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540)
* pin pydantic-monty to 0.0.8

* rename tool/prompt/resource base modules to avoid decorator name shadow

* add sys.modules shims for old submodule import paths

* preserve original module paths in deprecation warnings

* clarify when sys.modules shims can be removed
2026-03-17 18:11:42 -04:00
Jeremiah Lowin
ea1328660e
Fix NameError with future annotations and Context/Depends parameters (#3243)
* Fix NameError with future annotations and Context/Depends parameters

Closes #3238, closes #905

* chore: Update SDK documentation

* Drop unnecessary pre-resolution of annotations

Pydantic (even 2.11.7) uses __module__ not __globals__ to resolve
annotations, so setting __module__ alone is sufficient.

* chore: Update SDK documentation

* Restore annotation pre-resolution for Pydantic compat

The wrapper's __globals__ is read-only and points to dependencies.py,
so some Pydantic versions use it instead of __module__ when resolving
string annotations. Pre-resolving via get_type_hints on the original
function ensures annotations are type objects before Pydantic sees them.

* chore: Update SDK documentation

---------

Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-20 09:22:10 -05:00
Jeremiah Lowin
f950b8ca95
Support from __future__ import annotations (#1199) 2025-07-20 21:05:13 -04:00