Skip to content
Merged
11 changes: 9 additions & 2 deletions fastapi/dependencies/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dataclasses
import inspect
import sys
from contextlib import AsyncExitStack, contextmanager
from copy import copy, deepcopy
from dataclasses import dataclass
Expand Down Expand Up @@ -191,7 +192,10 @@ def get_flat_params(dependant: Dependant) -> List[ModelField]:


def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
signature = inspect.signature(call)
if sys.version_info >= (3, 10):
signature = inspect.signature(call, eval_str=True)
else:
signature = inspect.signature(call)
Comment on lines +195 to +198
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes jupyverse crash with:

NameError: name 'NoAuthStrategy' is not defined

Which doesn't make sense to me, because NoAuthStrategy is defined here and used in the same file.
There is also fastapi-users involved, so I'm pinging @frankie567 here but I don't think there's anything wrong there.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please share the full stacktrace and a reproducer script and how to run it?

Copy link
Contributor

@davidbrochart davidbrochart Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, you can reproduce with:

pip install jupyverse[jupyterlab,auth]
jupyverse

And the stack trace is:

Details
(tmp-jupyverse) david@david-laptop:~/tmp/jupyverse$ jupyverse --port 8001
2025-12-05 15:54:37 [info     ] Server running                 [jupyverse_api.main] url='http://127.0.0.1:8001?token=b90daa5d2e624196861bc6f9d430ddd4'
^C(tmp-jupyverse) david@david-laptop:~/tmp/jupyverse$ nvim /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/dependencies/utils.py
(tmp-jupyverse) david@david-laptop:~/tmp/jupyverse$ jupyverse --port 8001
2025-12-05 15:54:50 [critical ] Module failed while preparing  [fps._module] path=jupyverse.auth
2025-12-05 15:54:52 [critical ] Module could not get value     [fps._module] path=jupyverse.terminals value_type=<class 'jupyverse_api.auth.Auth'>
2025-12-05 15:54:52 [critical ] Module could not get value     [fps._module] path=jupyverse.jupyterlab value_type=<class 'jupyverse_api.auth.Auth'>
2025-12-05 15:54:52 [critical ] Module could not get value     [fps._module] path=jupyverse.kernels value_type=<class 'jupyverse_api.auth.Auth'>
2025-12-05 15:54:52 [critical ] Module could not get value     [fps._module] path=jupyverse.contents value_type=<class 'jupyverse_api.auth.Auth'>
2025-12-05 15:54:52 [critical ] Module could not get value     [fps._module] path=jupyverse.yjs value_type=<class 'jupyverse_api.auth.Auth'>
2025-12-05 15:54:52 [critical ] Module could not get value     [fps._module] path=jupyverse.lab value_type=<class 'jupyverse_api.auth.Auth'>
2025-12-05 15:54:52 [critical ] Module could not get value     [fps._module] path=jupyverse.nbconvert value_type=<class 'jupyverse_api.auth.Auth'>
2025-12-05 15:54:52 [critical ] Application failed             [fps._module]
2025-12-05 15:54:52 [critical ] Exception                      [fps._module]
╭──────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────╮
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fps/_module.py:497 in _prepare_and_done                                                    │
│                                                                                                                                                                           │
│   494 │   │   │   log.critical("Module failed while preparing", path=self.path)                ╭────────────────────────── locals ──────────────────────────╮             │
│   495 │                                                                                        │ self = <fps_auth.main.AuthModule object at 0x7c1ae146a900> │             │
│   496 │   async def _prepare_and_done(self) -> None:                                           ╰────────────────────────────────────────────────────────────╯             │
│ ❱ 497 │   │   await self.prepare()                                                                                                                                        │
│   498 │   │   if not self._prepared.is_set():                                                                                                                             │
│   499 │   │   │   self.done()                                                                                                                                             │
│   500                                                                                                                                                                     │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fps_auth/main.py:26 in prepare                                                             │
│                                                                                                                                                                           │
│   23 │   │   app = await self.get(App)                                                        ╭─────────────────────────────── locals ────────────────────────────────╮   │
│   24 │   │   frontend_config = await self.get(FrontendConfig)                                 │             app = <jupyverse_api.app.App object at 0x7c1ae1155fd0>    │   │
│   25 │   │                                                                                    │ frontend_config = FrontendConfig(base_url='/', collaborative=False)   │   │
│ ❱ 26 │   │   auth = auth_factory(app, self.config, frontend_config)                           │            self = <fps_auth.main.AuthModule object at 0x7c1ae146a900> │   │
│   27 │   │   self.put(auth, Auth)                                                             ╰───────────────────────────────────────────────────────────────────────╯   │
│   28 │   │                                                                                                                                                                │
│   29 │   │   await auth.db.create_db_and_tables()                                                                                                                         │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fps_auth/routes.py:165 in auth_factory                                                     │
│                                                                                                                                                                           │
│   162 │   │   ) -> Callable[[Any], Awaitable[tuple[Any, dict[str, list[str]] | None] | None]]:                                                                            │
│   163 │   │   │   return backend.websocket_auth(permissions)                                                                                                              │
│   164 │                                                                                                                                                                   │
│ ❱ 165 │   return _Auth()                                                                                                                                                  │
│   166                                                                                                                                                                     │
│   167                                                                                                                                                                     │
│   168 # From https://en.wikipedia.org/wiki/Moons_of_Jupiter                                                                                                               │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │             app = <jupyverse_api.app.App object at 0x7c1ae1155fd0>                                                                                                    │ │
│ │     auth_config = _AuthConfig(                                                                                                                                        │ │
│ │                   │   client_id='',                                                                                                                                   │ │
│ │                   │   client_secret='',                                                                                                                               │ │
│ │                   │   redirect_uri='',                                                                                                                                │ │
│ │                   │   mode='token',                                                                                                                                   │ │
│ │                   │   token='65e5df05003e46bc99e2eadbc010b1a8',                                                                                                       │ │
│ │                   │   global_email='[email protected]',                                                                                                               │ │
│ │                   │   cookie_secure=False,                                                                                                                            │ │
│ │                   │   clear_users=False,                                                                                                                              │ │
│ │                   │   test=False,                                                                                                                                     │ │
│ │                   │   login_url='/login',                                                                                                                             │ │
│ │                   │   directory=None                                                                                                                                  │ │
│ │                   )                                                                                                                                                   │ │
│ │         backend = Res(                                                                                                                                                │ │
│ │                   │   cookie_authentication=<fastapi_users.authentication.backend.AuthenticationBackend object at 0x7c1adfedd590>,                                    │ │
│ │                   │   current_user=<function get_backend.<locals>.current_user at 0x7c1adff26090>,                                                                    │ │
│ │                   │   update_user=<function get_backend.<locals>.update_user at 0x7c1adff26560>,                                                                      │ │
│ │                   │   fapi_users=<fastapi_users.fastapi_users.FastAPIUsers object at 0x7c1adff023c0>,                                                                 │ │
│ │                   │   get_user_manager=<function get_backend.<locals>.get_user_manager at 0x7c1adff25dd0>,                                                            │ │
│ │                   │   github_authentication=<httpx_oauth.clients.github.GitHubOAuth2 object at 0x7c1adff02270>,                                                       │ │
│ │                   │   github_cookie_authentication=<fastapi_users.authentication.backend.AuthenticationBackend object at 0x7c1adfedd810>,                             │ │
│ │                   │   websocket_auth=<function get_backend.<locals>.websocket_auth at 0x7c1adff261f0>                                                                 │ │
│ │                   )                                                                                                                                                   │ │
│ │              db = Res(                                                                                                                                                │ │
│ │                   │   User=<class 'fps_auth.db.User'>,                                                                                                                │ │
│ │                   │   async_session_maker=async_sessionmaker(class_='AsyncSession', bind=<sqlalchemy.ext.asyncio.engine.AsyncEngine object at 0x7c1adff214d0>,        │ │
│ │                   autoflush=True, expire_on_commit=False),                                                                                                            │ │
│ │                   │   create_db_and_tables=<function get_db.<locals>.create_db_and_tables at 0x7c1adff24b40>,                                                         │ │
│ │                   │   get_async_session=<function get_db.<locals>.get_async_session at 0x7c1adff24ca0>,                                                               │ │
│ │                   │   get_user_db=<function get_db.<locals>.get_user_db at 0x7c1adff24e00>,                                                                           │ │
│ │                   │   secret='72df0bef4aba73844e13fcce9f548f03df737972778bf9889e754201bd395e72'                                                                       │ │
│ │                   )                                                                                                                                                   │ │
│ │ frontend_config = FrontendConfig(base_url='/', collaborative=False)                                                                                                   │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fps_auth/routes.py:62 in __init__                                                          │
│                                                                                                                                                                           │
│    59 │   │   │                                                                                                                                                           │
│    60 │   │   │   router = APIRouter()                                                                                                                                    │
│    61 │   │   │                                                                                                                                                           │
│ ❱  62 │   │   │   @router.get("/auth/users")                                                                                                                              │
│    63 │   │   │   async def get_users(                                                                                                                                    │
│    64 │   │   │   │   user: UserRead = Depends(backend.current_user(permissions={"admin":                                                                                 │
│       ["read"]})),                                                                                                                                                        │
│    65 │   │   │   ):                                                                                                                                                      │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │     app = <jupyverse_api.app.App object at 0x7c1ae1155fd0>                                                                                                            │ │
│ │ backend = Res(                                                                                                                                                        │ │
│ │           │   cookie_authentication=<fastapi_users.authentication.backend.AuthenticationBackend object at 0x7c1adfedd590>,                                            │ │
│ │           │   current_user=<function get_backend.<locals>.current_user at 0x7c1adff26090>,                                                                            │ │
│ │           │   update_user=<function get_backend.<locals>.update_user at 0x7c1adff26560>,                                                                              │ │
│ │           │   fapi_users=<fastapi_users.fastapi_users.FastAPIUsers object at 0x7c1adff023c0>,                                                                         │ │
│ │           │   get_user_manager=<function get_backend.<locals>.get_user_manager at 0x7c1adff25dd0>,                                                                    │ │
│ │           │   github_authentication=<httpx_oauth.clients.github.GitHubOAuth2 object at 0x7c1adff02270>,                                                               │ │
│ │           │   github_cookie_authentication=<fastapi_users.authentication.backend.AuthenticationBackend object at 0x7c1adfedd810>,                                     │ │
│ │           │   websocket_auth=<function get_backend.<locals>.websocket_auth at 0x7c1adff261f0>                                                                         │ │
│ │           )                                                                                                                                                           │ │
│ │      db = Res(                                                                                                                                                        │ │
│ │           │   User=<class 'fps_auth.db.User'>,                                                                                                                        │ │
│ │           │   async_session_maker=async_sessionmaker(class_='AsyncSession', bind=<sqlalchemy.ext.asyncio.engine.AsyncEngine object at 0x7c1adff214d0>,                │ │
│ │           autoflush=True, expire_on_commit=False),                                                                                                                    │ │
│ │           │   create_db_and_tables=<function get_db.<locals>.create_db_and_tables at 0x7c1adff24b40>,                                                                 │ │
│ │           │   get_async_session=<function get_db.<locals>.get_async_session at 0x7c1adff24ca0>,                                                                       │ │
│ │           │   get_user_db=<function get_db.<locals>.get_user_db at 0x7c1adff24e00>,                                                                                   │ │
│ │           │   secret='72df0bef4aba73844e13fcce9f548f03df737972778bf9889e754201bd395e72'                                                                               │ │
│ │           )                                                                                                                                                           │ │
│ │  router = <fastapi.routing.APIRouter object at 0x7c1adff28180>                                                                                                        │ │
│ │    self = <fps_auth.routes.auth_factory.<locals>._Auth object at 0x7c1adff027b0>                                                                                      │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/routing.py:1072 in decorator                                                       │
│                                                                                                                                                                           │
│   1069 │   │   ),                                                                                                                                                         │
│   1070 │   ) -> Callable[[DecoratedCallable], DecoratedCallable]:                                                                                                         │
│   1071 │   │   def decorator(func: DecoratedCallable) -> DecoratedCallable:                                                                                               │
│ ❱ 1072 │   │   │   self.add_api_route(                                                                                                                                    │
│   1073 │   │   │   │   path,                                                                                                                                              │
│   1074 │   │   │   │   func,                                                                                                                                              │
│   1075 │   │   │   │   response_model=response_model,                                                                                                                     │
│                                                                                                                                                                           │
│ ╭──────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                │
│ │                       callbacks = None                                                                 │                                                                │
│ │                    dependencies = None                                                                 │                                                                │
│ │                      deprecated = None                                                                 │                                                                │
│ │                     description = None                                                                 │                                                                │
│ │     generate_unique_id_function = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfd10> │                                                                │
│ │               include_in_schema = True                                                                 │                                                                │
│ │                         methods = ['GET']                                                              │                                                                │
│ │                            name = None                                                                 │                                                                │
│ │                   openapi_extra = None                                                                 │                                                                │
│ │                    operation_id = None                                                                 │                                                                │
│ │                            path = '/auth/users'                                                        │                                                                │
│ │                  response_class = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfa10> │                                                                │
│ │            response_description = 'Successful Response'                                                │                                                                │
│ │                  response_model = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae4fa5090> │                                                                │
│ │         response_model_by_alias = True                                                                 │                                                                │
│ │          response_model_exclude = None                                                                 │                                                                │
│ │ response_model_exclude_defaults = False                                                                │                                                                │
│ │     response_model_exclude_none = False                                                                │                                                                │
│ │    response_model_exclude_unset = False                                                                │                                                                │
│ │          response_model_include = None                                                                 │                                                                │
│ │                       responses = None                                                                 │                                                                │
│ │                            self = <fastapi.routing.APIRouter object at 0x7c1adff28180>                 │                                                                │
│ │                     status_code = None                                                                 │                                                                │
│ │                         summary = None                                                                 │                                                                │
│ │                            tags = None                                                                 │                                                                │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/routing.py:1011 in add_api_route                                                   │
│                                                                                                                                                                           │
│   1008 │   │   current_generate_unique_id = get_value_or_default(                                                                                                         │
│   1009 │   │   │   generate_unique_id_function, self.generate_unique_id_function                                                                                          │
│   1010 │   │   )                                                                                                                                                          │
│ ❱ 1011 │   │   route = route_class(                                                                                                                                       │
│   1012 │   │   │   self.prefix + path,                                                                                                                                    │
│   1013 │   │   │   endpoint=endpoint,                                                                                                                                     │
│   1014 │   │   │   response_model=response_model,                                                                                                                         │
│                                                                                                                                                                           │
│ ╭──────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                │
│ │                       callbacks = None                                                                 │                                                                │
│ │              combined_responses = {}                                                                   │                                                                │
│ │               current_callbacks = []                                                                   │                                                                │
│ │            current_dependencies = []                                                                   │                                                                │
│ │      current_generate_unique_id = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfd10> │                                                                │
│ │          current_response_class = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfa10> │                                                                │
│ │                    current_tags = []                                                                   │                                                                │
│ │                    dependencies = None                                                                 │                                                                │
│ │                      deprecated = None                                                                 │                                                                │
│ │                     description = None                                                                 │                                                                │
│ │     generate_unique_id_function = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfd10> │                                                                │
│ │               include_in_schema = True                                                                 │                                                                │
│ │                         methods = ['GET']                                                              │                                                                │
│ │                            name = None                                                                 │                                                                │
│ │                   openapi_extra = None                                                                 │                                                                │
│ │                    operation_id = None                                                                 │                                                                │
│ │                            path = '/auth/users'                                                        │                                                                │
│ │                  response_class = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfa10> │                                                                │
│ │            response_description = 'Successful Response'                                                │                                                                │
│ │                  response_model = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae4fa5090> │                                                                │
│ │         response_model_by_alias = True                                                                 │                                                                │
│ │          response_model_exclude = None                                                                 │                                                                │
│ │ response_model_exclude_defaults = False                                                                │                                                                │
│ │     response_model_exclude_none = False                                                                │                                                                │
│ │    response_model_exclude_unset = False                                                                │                                                                │
│ │          response_model_include = None                                                                 │                                                                │
│ │                       responses = {}                                                                   │                                                                │
│ │            route_class_override = None                                                                 │                                                                │
│ │                            self = <fastapi.routing.APIRouter object at 0x7c1adff28180>                 │                                                                │
│ │                     status_code = None                                                                 │                                                                │
│ │                         summary = None                                                                 │                                                                │
│ │                            tags = None                                                                 │                                                                │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/routing.py:630 in __init__                                                         │
│                                                                                                                                                                           │
│    627 │   │   │   self.response_fields = {}                                                                                                                              │
│    628 │   │                                                                                                                                                              │
│    629 │   │   assert callable(endpoint), "An endpoint must be a callable"                                                                                                │
│ ❱  630 │   │   self.dependant = get_dependant(                                                                                                                            │
│    631 │   │   │   path=self.path_format, call=self.endpoint, scope="function"                                                                                            │
│    632 │   │   )                                                                                                                                                          │
│    633 │   │   for depends in self.dependencies[::-1]:                                                                                                                    │
│                                                                                                                                                                           │
│ ╭──────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                │
│ │                       callbacks = []                                                                   │                                                                │
│ │                    dependencies = []                                                                   │                                                                │
│ │   dependency_overrides_provider = None                                                                 │                                                                │
│ │                      deprecated = None                                                                 │                                                                │
│ │                     description = None                                                                 │                                                                │
│ │     generate_unique_id_function = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfd10> │                                                                │
│ │               include_in_schema = True                                                                 │                                                                │
│ │                         methods = ['GET']                                                              │                                                                │
│ │                            name = None                                                                 │                                                                │
│ │                   openapi_extra = None                                                                 │                                                                │
│ │                    operation_id = None                                                                 │                                                                │
│ │                            path = '/auth/users'                                                        │                                                                │
│ │                  response_class = <fastapi.datastructures.DefaultPlaceholder object at 0x7c1ae52cfa10> │                                                                │
│ │            response_description = 'Successful Response'                                                │                                                                │
│ │                 response_fields = {}                                                                   │                                                                │
│ │                  response_model = None                                                                 │                                                                │
│ │         response_model_by_alias = True                                                                 │                                                                │
│ │          response_model_exclude = None                                                                 │                                                                │
│ │ response_model_exclude_defaults = False                                                                │                                                                │
│ │     response_model_exclude_none = False                                                                │                                                                │
│ │    response_model_exclude_unset = False                                                                │                                                                │
│ │          response_model_include = None                                                                 │                                                                │
│ │                       responses = {}                                                                   │                                                                │
│ │               return_annotation = None                                                                 │                                                                │
│ │                            self = APIRoute(path='/auth/users', name='get_users', methods=['GET'])      │                                                                │
│ │                     status_code = None                                                                 │                                                                │
│ │                         summary = None                                                                 │                                                                │
│ │                            tags = []                                                                   │                                                                │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/dependencies/utils.py:290 in get_dependant                                         │
│                                                                                                                                                                           │
│    287 │   │   │   if isinstance(param_details.depends, params.Security):                                                                                                 │
│    288 │   │   │   │   if param_details.depends.scopes:                                                                                                                   │
│    289 │   │   │   │   │   sub_own_oauth_scopes = list(param_details.depends.scopes)                                                                                      │
│ ❱  290 │   │   │   sub_dependant = get_dependant(                                                                                                                         │
│    291 │   │   │   │   path=path,                                                                                                                                         │
│    292 │   │   │   │   call=param_details.depends.dependency,                                                                                                             │
│    293 │   │   │   │   name=param_name,                                                                                                                                   │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │       current_scopes = []                                                                                                                                             │ │
│ │            dependant = Dependant(                                                                                                                                     │ │
│ │                        │   path_params=[],                                                                                                                            │ │
│ │                        │   query_params=[],                                                                                                                           │ │
│ │                        │   header_params=[],                                                                                                                          │ │
│ │                        │   cookie_params=[],                                                                                                                          │ │
│ │                        │   body_params=[],                                                                                                                            │ │
│ │                        │   dependencies=[],                                                                                                                           │ │
│ │                        │   security_requirements=[],                                                                                                                  │ │
│ │                        │   name=None,                                                                                                                                 │ │
│ │                        │   call=<function auth_factory.<locals>._Auth.__init__.<locals>.get_users at 0x7c1adff278a0>,                                                 │ │
│ │                        │   request_param_name=None,                                                                                                                   │ │
│ │                        │   websocket_param_name=None,                                                                                                                 │ │
│ │                        │   http_connection_param_name=None,                                                                                                           │ │
│ │                        │   response_param_name=None,                                                                                                                  │ │
│ │                        │   background_tasks_param_name=None,                                                                                                          │ │
│ │                        │   security_scopes_param_name=None,                                                                                                           │ │
│ │                        │   own_oauth_scopes=None,                                                                                                                     │ │
│ │                        │   parent_oauth_scopes=None,                                                                                                                  │ │
│ │                        │   use_cache=True,                                                                                                                            │ │
│ │                        │   path='/auth/users',                                                                                                                        │ │
│ │                        │   scope='function'                                                                                                                           │ │
│ │                        )                                                                                                                                              │ │
│ │   endpoint_signature = <Signature (user: fps_auth.models.UserRead = Depends(dependency=<function get_backend.<locals>.current_user.<locals>._ at 0x7c1adff27950>,     │ │
│ │                        use_cache=True, scope=None))>                                                                                                                  │ │
│ │        is_path_param = False                                                                                                                                          │ │
│ │                 name = None                                                                                                                                           │ │
│ │     own_oauth_scopes = None                                                                                                                                           │ │
│ │                param = <Parameter "user: fps_auth.models.UserRead = Depends(dependency=<function get_backend.<locals>.current_user.<locals>._ at 0x7c1adff27950>,     │ │
│ │                        use_cache=True, scope=None)">                                                                                                                  │ │
│ │        param_details = ParamDetails(                                                                                                                                  │ │
│ │                        │   type_annotation=<class 'fps_auth.models.UserRead'>,                                                                                        │ │
│ │                        │   depends=Depends(dependency=<function get_backend.<locals>.current_user.<locals>._ at 0x7c1adff27950>, use_cache=True, scope=None),         │ │
│ │                        │   field=None                                                                                                                                 │ │
│ │                        )                                                                                                                                              │ │
│ │           param_name = 'user'                                                                                                                                         │ │
│ │  parent_oauth_scopes = None                                                                                                                                           │ │
│ │                 path = '/auth/users'                                                                                                                                  │ │
│ │     path_param_names = set()                                                                                                                                          │ │
│ │                scope = 'function'                                                                                                                                     │ │
│ │     signature_params = mappingproxy({                                                                                                                                 │ │
│ │                        │   'user': <Parameter "user: fps_auth.models.UserRead = Depends(dependency=<function get_backend.<locals>.current_user.<locals>._ at          │ │
│ │                        0x7c1adff27950>, use_cache=True, scope=None)">                                                                                                 │ │
│ │                        })                                                                                                                                             │ │
│ │ sub_own_oauth_scopes = []                                                                                                                                             │ │
│ │            use_cache = True                                                                                                                                           │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/dependencies/utils.py:290 in get_dependant                                         │
│                                                                                                                                                                           │
│    287 │   │   │   if isinstance(param_details.depends, params.Security):                                                                                                 │
│    288 │   │   │   │   if param_details.depends.scopes:                                                                                                                   │
│    289 │   │   │   │   │   sub_own_oauth_scopes = list(param_details.depends.scopes)                                                                                      │
│ ❱  290 │   │   │   sub_dependant = get_dependant(                                                                                                                         │
│    291 │   │   │   │   path=path,                                                                                                                                         │
│    292 │   │   │   │   call=param_details.depends.dependency,                                                                                                             │
│    293 │   │   │   │   name=param_name,                                                                                                                                   │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │       current_scopes = []                                                                                                                                             │ │
│ │            dependant = Dependant(                                                                                                                                     │ │
│ │                        │   path_params=[],                                                                                                                            │ │
│ │                        │   query_params=[                                                                                                                             │ │
│ │                        │   │   ModelField(                                                                                                                            │ │
│ │                        │   │   │   field_info=Query(annotation=Union[str, NoneType], required=False, default=None, alias='token', json_schema_extra={}),              │ │
│ │                        │   │   │   name='token',                                                                                                                      │ │
│ │                        │   │   │   mode='validation'                                                                                                                  │ │
│ │                        │   │   )                                                                                                                                      │ │
│ │                        │   ],                                                                                                                                         │ │
│ │                        │   header_params=[],                                                                                                                          │ │
│ │                        │   cookie_params=[],                                                                                                                          │ │
│ │                        │   body_params=[],                                                                                                                            │ │
│ │                        │   dependencies=[],                                                                                                                           │ │
│ │                        │   security_requirements=[],                                                                                                                  │ │
│ │                        │   name='user',                                                                                                                               │ │
│ │                        │   call=<function get_backend.<locals>.current_user.<locals>._ at 0x7c1adff27950>,                                                            │ │
│ │                        │   request_param_name=None,                                                                                                                   │ │
│ │                        │   websocket_param_name=None,                                                                                                                 │ │
│ │                        │   http_connection_param_name=None,                                                                                                           │ │
│ │                        │   response_param_name='response',                                                                                                            │ │
│ │                        │   background_tasks_param_name=None,                                                                                                          │ │
│ │                        │   security_scopes_param_name=None,                                                                                                           │ │
│ │                        │   own_oauth_scopes=[],                                                                                                                       │ │
│ │                        │   parent_oauth_scopes=[],                                                                                                                    │ │
│ │                        │   use_cache=True,                                                                                                                            │ │
│ │                        │   path='/auth/users',                                                                                                                        │ │
│ │                        │   scope=None                                                                                                                                 │ │
│ │                        )                                                                                                                                              │ │
│ │   endpoint_signature = <Signature (response: starlette.responses.Response, token: str | None = None, user: fps_auth.db.User | None = Depends(dependency=<function     │ │
│ │                        Authenticator.current_user.<locals>.current_user_dependency at 0x7c1adff27a00>, use_cache=True, scope=None), user_manager:                     │ │
│ │                        fastapi_users.manager.BaseUserManager[fps_auth.db.User, ~ID] = Depends(dependency=<function get_backend.<locals>.get_user_manager at           │ │
│ │                        0x7c1adff25dd0>, use_cache=True, scope=None))>                                                                                                 │ │
│ │        is_path_param = False                                                                                                                                          │ │
│ │                 name = 'user'                                                                                                                                         │ │
│ │     own_oauth_scopes = []                                                                                                                                             │ │
│ │                param = <Parameter "user: fps_auth.db.User | None = Depends(dependency=<function Authenticator.current_user.<locals>.current_user_dependency at        │ │
│ │                        0x7c1adff27a00>, use_cache=True, scope=None)">                                                                                                 │ │
│ │        param_details = ParamDetails(                                                                                                                                  │ │
│ │                        │   type_annotation=fps_auth.db.User | None,                                                                                                   │ │
│ │                        │   depends=Depends(                                                                                                                           │ │
│ │                        │   │   dependency=<function Authenticator.current_user.<locals>.current_user_dependency at 0x7c1adff27a00>,                                   │ │
│ │                        │   │   use_cache=True,                                                                                                                        │ │
│ │                        │   │   scope=None                                                                                                                             │ │
│ │                        │   ),                                                                                                                                         │ │
│ │                        │   field=None                                                                                                                                 │ │
│ │                        )                                                                                                                                              │ │
│ │           param_name = 'user'                                                                                                                                         │ │
│ │  parent_oauth_scopes = []                                                                                                                                             │ │
│ │                 path = '/auth/users'                                                                                                                                  │ │
│ │     path_param_names = set()                                                                                                                                          │ │
│ │                scope = None                                                                                                                                           │ │
│ │     signature_params = mappingproxy({                                                                                                                                 │ │
│ │                        │   'response': <Parameter "response: starlette.responses.Response">,                                                                          │ │
│ │                        │   'token': <Parameter "token: str | None = None">,                                                                                           │ │
│ │                        │   'user': <Parameter "user: fps_auth.db.User | None = Depends(dependency=<function                                                           │ │
│ │                        Authenticator.current_user.<locals>.current_user_dependency at 0x7c1adff27a00>, use_cache=True, scope=None)">,                                 │ │
│ │                        │   'user_manager': <Parameter "user_manager: fastapi_users.manager.BaseUserManager[fps_auth.db.User, ~ID] = Depends(dependency=<function      │ │
│ │                        get_backend.<locals>.get_user_manager at 0x7c1adff25dd0>, use_cache=True, scope=None)">                                                        │ │
│ │                        })                                                                                                                                             │ │
│ │ sub_own_oauth_scopes = []                                                                                                                                             │ │
│ │            use_cache = True                                                                                                                                           │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/dependencies/utils.py:290 in get_dependant                                         │
│                                                                                                                                                                           │
│    287 │   │   │   if isinstance(param_details.depends, params.Security):                                                                                                 │
│    288 │   │   │   │   if param_details.depends.scopes:                                                                                                                   │
│    289 │   │   │   │   │   sub_own_oauth_scopes = list(param_details.depends.scopes)                                                                                      │
│ ❱  290 │   │   │   sub_dependant = get_dependant(                                                                                                                         │
│    291 │   │   │   │   path=path,                                                                                                                                         │
│    292 │   │   │   │   call=param_details.depends.dependency,                                                                                                             │
│    293 │   │   │   │   name=param_name,                                                                                                                                   │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │       current_scopes = []                                                                                                                                             │ │
│ │            dependant = Dependant(                                                                                                                                     │ │
│ │                        │   path_params=[],                                                                                                                            │ │
│ │                        │   query_params=[],                                                                                                                           │ │
│ │                        │   header_params=[],                                                                                                                          │ │
│ │                        │   cookie_params=[],                                                                                                                          │ │
│ │                        │   body_params=[],                                                                                                                            │ │
│ │                        │   dependencies=[                                                                                                                             │ │
│ │                        │   │   Dependant(                                                                                                                             │ │
│ │                        │   │   │   path_params=[],                                                                                                                    │ │
│ │                        │   │   │   query_params=[],                                                                                                                   │ │
│ │                        │   │   │   header_params=[],                                                                                                                  │ │
│ │                        │   │   │   cookie_params=[],                                                                                                                  │ │
│ │                        │   │   │   body_params=[],                                                                                                                    │ │
│ │                        │   │   │   dependencies=[                                                                                                                     │ │
│ │                        │   │   │   │   Dependant(                                                                                                                     │ │
│ │                        │   │   │   │   │   path_params=[],                                                                                                            │ │
│ │                        │   │   │   │   │   query_params=[],                                                                                                           │ │
│ │                        │   │   │   │   │   header_params=[],                                                                                                          │ │
│ │                        │   │   │   │   │   cookie_params=[],                                                                                                          │ │
│ │                        │   │   │   │   │   body_params=[],                                                                                                            │ │
│ │                        │   │   │   │   │   dependencies=[                                                                                                             │ │
│ │                        │   │   │   │   │   │   Dependant(                                                                                                             │ │
│ │                        │   │   │   │   │   │   │   path_params=[],                                                                                                    │ │
│ │                        │   │   │   │   │   │   │   query_params=[],                                                                                                   │ │
│ │                        │   │   │   │   │   │   │   header_params=[],                                                                                                  │ │
│ │                        │   │   │   │   │   │   │   cookie_params=[],                                                                                                  │ │
│ │                        │   │   │   │   │   │   │   body_params=[],                                                                                                    │ │
│ │                        │   │   │   │   │   │   │   dependencies=[],                                                                                                   │ │
│ │                        │   │   │   │   │   │   │   security_requirements=[],                                                                                          │ │
│ │                        │   │   │   │   │   │   │   name='session',                                                                                                    │ │
│ │                        │   │   │   │   │   │   │   call=<function get_db.<locals>.get_async_session at 0x7c1adff24ca0>,                                               │ │
│ │                        │   │   │   │   │   │   │   request_param_name=None,                                                                                           │ │
│ │                        │   │   │   │   │   │   │   websocket_param_name=None,                                                                                         │ │
│ │                        │   │   │   │   │   │   │   http_connection_param_name=None,                                                                                   │ │
│ │                        │   │   │   │   │   │   │   response_param_name=None,                                                                                          │ │
│ │                        │   │   │   │   │   │   │   background_tasks_param_name=None,                                                                                  │ │
│ │                        │   │   │   │   │   │   │   security_scopes_param_name=None,                                                                                   │ │
│ │                        │   │   │   │   │   │   │   own_oauth_scopes=[],                                                                                               │ │
│ │                        │   │   │   │   │   │   │   parent_oauth_scopes=[],                                                                                            │ │
│ │                        │   │   │   │   │   │   │   use_cache=True,                                                                                                    │ │
│ │                        │   │   │   │   │   │   │   path='/auth/users',                                                                                                │ │
│ │                        │   │   │   │   │   │   │   scope=None                                                                                                         │ │
│ │                        │   │   │   │   │   │   )                                                                                                                      │ │
│ │                        │   │   │   │   │   ],                                                                                                                         │ │
│ │                        │   │   │   │   │   security_requirements=[],                                                                                                  │ │
│ │                        │   │   │   │   │   name='user_db',                                                                                                            │ │
│ │                        │   │   │   │   │   call=<function get_db.<locals>.get_user_db at 0x7c1adff24e00>,                                                             │ │
│ │                        │   │   │   │   │   request_param_name=None,                                                                                                   │ │
│ │                        │   │   │   │   │   websocket_param_name=None,                                                                                                 │ │
│ │                        │   │   │   │   │   http_connection_param_name=None,                                                                                           │ │
│ │                        │   │   │   │   │   response_param_name=None,                                                                                                  │ │
│ │                        │   │   │   │   │   background_tasks_param_name=None,                                                                                          │ │
│ │                        │   │   │   │   │   security_scopes_param_name=None,                                                                                           │ │
│ │                        │   │   │   │   │   own_oauth_scopes=[],                                                                                                       │ │
│ │                        │   │   │   │   │   parent_oauth_scopes=[],                                                                                                    │ │
│ │                        │   │   │   │   │   use_cache=True,                                                                                                            │ │
│ │                        │   │   │   │   │   path='/auth/users',                                                                                                        │ │
│ │                        │   │   │   │   │   scope=None                                                                                                                 │ │
│ │                        │   │   │   │   )                                                                                                                              │ │
│ │                        │   │   │   ],                                                                                                                                 │ │
│ │                        │   │   │   security_requirements=[],                                                                                                          │ │
│ │                        │   │   │   name='user_manager',                                                                                                               │ │
│ │                        │   │   │   call=<function get_backend.<locals>.get_user_manager at 0x7c1adff25dd0>,                                                           │ │
│ │                        │   │   │   request_param_name=None,                                                                                                           │ │
│ │                        │   │   │   websocket_param_name=None,                                                                                                         │ │
│ │                        │   │   │   http_connection_param_name=None,                                                                                                   │ │
│ │                        │   │   │   response_param_name=None,                                                                                                          │ │
│ │                        │   │   │   background_tasks_param_name=None,                                                                                                  │ │
│ │                        │   │   │   security_scopes_param_name=None,                                                                                                   │ │
│ │                        │   │   │   own_oauth_scopes=[],                                                                                                               │ │
│ │                        │   │   │   parent_oauth_scopes=[],                                                                                                            │ │
│ │                        │   │   │   use_cache=True,                                                                                                                    │ │
│ │                        │   │   │   path='/auth/users',                                                                                                                │ │
│ │                        │   │   │   scope=None                                                                                                                         │ │
│ │                        │   │   ),                                                                                                                                     │ │
│ │                        │   │   Dependant(                                                                                                                             │ │
│ │                        │   │   │   path_params=[],                                                                                                                    │ │
│ │                        │   │   │   query_params=[],                                                                                                                   │ │
│ │                        │   │   │   header_params=[],                                                                                                                  │ │
│ │                        │   │   │   cookie_params=[],                                                                                                                  │ │
│ │                        │   │   │   body_params=[],                                                                                                                    │ │
│ │                        │   │   │   dependencies=[],                                                                                                                   │ │
│ │                        │   │   │   security_requirements=[],                                                                                                          │ │
│ │                        │   │   │   name='noauth',                                                                                                                     │ │
│ │                        │   │   │   call=<fps_auth.backends.get_backend.<locals>.NoAuthScheme object at 0x7c1adff01a90>,                                               │ │
│ │                        │   │   │   request_param_name=None,                                                                                                           │ │
│ │                        │   │   │   websocket_param_name=None,                                                                                                         │ │
│ │                        │   │   │   http_connection_param_name=None,                                                                                                   │ │
│ │                        │   │   │   response_param_name=None,                                                                                                          │ │
│ │                        │   │   │   background_tasks_param_name=None,                                                                                                  │ │
│ │                        │   │   │   security_scopes_param_name=None,                                                                                                   │ │
│ │                        │   │   │   own_oauth_scopes=[],                                                                                                               │ │
│ │                        │   │   │   parent_oauth_scopes=[],                                                                                                            │ │
│ │                        │   │   │   use_cache=True,                                                                                                                    │ │
│ │                        │   │   │   path='/auth/users',                                                                                                                │ │
│ │                        │   │   │   scope=None                                                                                                                         │ │
│ │                        │   │   )                                                                                                                                      │ │
│ │                        │   ],                                                                                                                                         │ │
│ │                        │   security_requirements=[],                                                                                                                  │ │
│ │                        │   name='user',                                                                                                                               │ │
│ │                        │   call=<function Authenticator.current_user.<locals>.current_user_dependency at 0x7c1adff27a00>,                                             │ │
│ │                        │   request_param_name=None,                                                                                                                   │ │
│ │                        │   websocket_param_name=None,                                                                                                                 │ │
│ │                        │   http_connection_param_name=None,                                                                                                           │ │
│ │                        │   response_param_name=None,                                                                                                                  │ │
│ │                        │   background_tasks_param_name=None,                                                                                                          │ │
│ │                        │   security_scopes_param_name=None,                                                                                                           │ │
│ │                        │   own_oauth_scopes=[],                                                                                                                       │ │
│ │                        │   parent_oauth_scopes=[],                                                                                                                    │ │
│ │                        │   use_cache=True,                                                                                                                            │ │
│ │                        │   path='/auth/users',                                                                                                                        │ │
│ │                        │   scope=None                                                                                                                                 │ │
│ │                        )                                                                                                                                              │ │
│ │   endpoint_signature = <Signature (user_manager=Depends(dependency=<function get_backend.<locals>.get_user_manager at 0x7c1adff25dd0>, use_cache=True, scope=None),   │ │
│ │                        noauth=Depends(dependency=<fps_auth.backends.get_backend.<locals>.NoAuthScheme object at 0x7c1adff01a90>, use_cache=True, scope=None),         │ │
│ │                        strategy_noauth=Depends(dependency=<function get_backend.<locals>.get_noauth_strategy at 0x7c1adff259b0>, use_cache=True, scope=None),         │ │
│ │                        cookie=Depends(dependency=<fastapi.security.api_key.APIKeyCookie object at 0x7c1adff01fd0>, use_cache=True, scope=None),                       │ │
│ │                        strategy_cookie=Depends(dependency=<function get_backend.<locals>.get_jwt_strategy at 0x7c1adff25b10>, use_cache=True, scope=None),            │ │
│ │                        github=Depends(dependency=<fastapi.security.api_key.APIKeyCookie object at 0x7c1adfedd6d0>, use_cache=True, scope=None),                       │ │
│ │                        strategy_github=Depends(dependency=<function get_backend.<locals>.get_jwt_strategy at 0x7c1adff25b10>, use_cache=True, scope=None),            │ │
│ │                        enabled_backends=Depends(dependency=<function get_backend.<locals>.get_enabled_backends at 0x7c1adff25e80>, use_cache=True, scope=None))>      │ │
│ │        is_path_param = False                                                                                                                                          │ │
│ │                 name = 'user'                                                                                                                                         │ │
│ │     own_oauth_scopes = []                                                                                                                                             │ │
│ │                param = <Parameter "strategy_noauth=Depends(dependency=<function get_backend.<locals>.get_noauth_strategy at 0x7c1adff259b0>, use_cache=True,          │ │
│ │                        scope=None)">                                                                                                                                  │ │
│ │        param_details = ParamDetails(                                                                                                                                  │ │
│ │                        │   type_annotation=typing.Any,                                                                                                                │ │
│ │                        │   depends=Depends(dependency=<function get_backend.<locals>.get_noauth_strategy at 0x7c1adff259b0>, use_cache=True, scope=None),             │ │
│ │                        │   field=None                                                                                                                                 │ │
│ │                        )                                                                                                                                              │ │
│ │           param_name = 'strategy_noauth'                                                                                                                              │ │
│ │  parent_oauth_scopes = []                                                                                                                                             │ │
│ │                 path = '/auth/users'                                                                                                                                  │ │
│ │     path_param_names = set()                                                                                                                                          │ │
│ │                scope = None                                                                                                                                           │ │
│ │     signature_params = mappingproxy({                                                                                                                                 │ │
│ │                        │   'user_manager': <Parameter "user_manager=Depends(dependency=<function get_backend.<locals>.get_user_manager at 0x7c1adff25dd0>,            │ │
│ │                        use_cache=True, scope=None)">,                                                                                                                 │ │
│ │                        │   'noauth': <Parameter "noauth=Depends(dependency=<fps_auth.backends.get_backend.<locals>.NoAuthScheme object at 0x7c1adff01a90>,            │ │
│ │                        use_cache=True, scope=None)">,                                                                                                                 │ │
│ │                        │   'strategy_noauth': <Parameter "strategy_noauth=Depends(dependency=<function get_backend.<locals>.get_noauth_strategy at 0x7c1adff259b0>,   │ │
│ │                        use_cache=True, scope=None)">,                                                                                                                 │ │
│ │                        │   'cookie': <Parameter "cookie=Depends(dependency=<fastapi.security.api_key.APIKeyCookie object at 0x7c1adff01fd0>, use_cache=True,          │ │
│ │                        scope=None)">,                                                                                                                                 │ │
│ │                        │   'strategy_cookie': <Parameter "strategy_cookie=Depends(dependency=<function get_backend.<locals>.get_jwt_strategy at 0x7c1adff25b10>,      │ │
│ │                        use_cache=True, scope=None)">,                                                                                                                 │ │
│ │                        │   'github': <Parameter "github=Depends(dependency=<fastapi.security.api_key.APIKeyCookie object at 0x7c1adfedd6d0>, use_cache=True,          │ │
│ │                        scope=None)">,                                                                                                                                 │ │
│ │                        │   'strategy_github': <Parameter "strategy_github=Depends(dependency=<function get_backend.<locals>.get_jwt_strategy at 0x7c1adff25b10>,      │ │
│ │                        use_cache=True, scope=None)">,                                                                                                                 │ │
│ │                        │   'enabled_backends': <Parameter "enabled_backends=Depends(dependency=<function get_backend.<locals>.get_enabled_backends at                 │ │
│ │                        0x7c1adff25e80>, use_cache=True, scope=None)">                                                                                                 │ │
│ │                        })                                                                                                                                             │ │
│ │        sub_dependant = Dependant(                                                                                                                                     │ │
│ │                        │   path_params=[],                                                                                                                            │ │
│ │                        │   query_params=[],                                                                                                                           │ │
│ │                        │   header_params=[],                                                                                                                          │ │
│ │                        │   cookie_params=[],                                                                                                                          │ │
│ │                        │   body_params=[],                                                                                                                            │ │
│ │                        │   dependencies=[],                                                                                                                           │ │
│ │                        │   security_requirements=[],                                                                                                                  │ │
│ │                        │   name='noauth',                                                                                                                             │ │
│ │                        │   call=<fps_auth.backends.get_backend.<locals>.NoAuthScheme object at 0x7c1adff01a90>,                                                       │ │
│ │                        │   request_param_name=None,                                                                                                                   │ │
│ │                        │   websocket_param_name=None,                                                                                                                 │ │
│ │                        │   http_connection_param_name=None,                                                                                                           │ │
│ │                        │   response_param_name=None,                                                                                                                  │ │
│ │                        │   background_tasks_param_name=None,                                                                                                          │ │
│ │                        │   security_scopes_param_name=None,                                                                                                           │ │
│ │                        │   own_oauth_scopes=[],                                                                                                                       │ │
│ │                        │   parent_oauth_scopes=[],                                                                                                                    │ │
│ │                        │   use_cache=True,                                                                                                                            │ │
│ │                        │   path='/auth/users',                                                                                                                        │ │
│ │                        │   scope=None                                                                                                                                 │ │
│ │                        )                                                                                                                                              │ │
│ │ sub_own_oauth_scopes = []                                                                                                                                             │ │
│ │            use_cache = True                                                                                                                                           │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/dependencies/utils.py:259 in get_dependant                                         │
│                                                                                                                                                                           │
│    256 │   )                                                                                                                                                              │
│    257 │   current_scopes = (parent_oauth_scopes or []) + (own_oauth_scopes or [])                                                                                        │
│    258 │   path_param_names = get_path_param_names(path)                                                                                                                  │
│ ❱  259 │   endpoint_signature = get_typed_signature(call)                                                                                                                 │
│    260 │   signature_params = endpoint_signature.parameters                                                                                                               │
│    261 │   if isinstance(call, SecurityBase):                                                                                                                             │
│    262 │   │   security_requirement = SecurityRequirement(                                                                                                                │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                 │
│ │      current_scopes = []                                                                              │                                                                 │
│ │           dependant = Dependant(                                                                      │                                                                 │
│ │                       │   path_params=[],                                                             │                                                                 │
│ │                       │   query_params=[],                                                            │                                                                 │
│ │                       │   header_params=[],                                                           │                                                                 │
│ │                       │   cookie_params=[],                                                           │                                                                 │
│ │                       │   body_params=[],                                                             │                                                                 │
│ │                       │   dependencies=[],                                                            │                                                                 │
│ │                       │   security_requirements=[],                                                   │                                                                 │
│ │                       │   name='strategy_noauth',                                                     │                                                                 │
│ │                       │   call=<function get_backend.<locals>.get_noauth_strategy at 0x7c1adff259b0>, │                                                                 │
│ │                       │   request_param_name=None,                                                    │                                                                 │
│ │                       │   websocket_param_name=None,                                                  │                                                                 │
│ │                       │   http_connection_param_name=None,                                            │                                                                 │
│ │                       │   response_param_name=None,                                                   │                                                                 │
│ │                       │   background_tasks_param_name=None,                                           │                                                                 │
│ │                       │   security_scopes_param_name=None,                                            │                                                                 │
│ │                       │   own_oauth_scopes=[],                                                        │                                                                 │
│ │                       │   parent_oauth_scopes=[],                                                     │                                                                 │
│ │                       │   use_cache=True,                                                             │                                                                 │
│ │                       │   path='/auth/users',                                                         │                                                                 │
│ │                       │   scope=None                                                                  │                                                                 │
│ │                       )                                                                               │                                                                 │
│ │                name = 'strategy_noauth'                                                               │                                                                 │
│ │    own_oauth_scopes = []                                                                              │                                                                 │
│ │ parent_oauth_scopes = []                                                                              │                                                                 │
│ │                path = '/auth/users'                                                                   │                                                                 │
│ │    path_param_names = set()                                                                           │                                                                 │
│ │               scope = None                                                                            │                                                                 │
│ │           use_cache = True                                                                            │                                                                 │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                 │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi/dependencies/utils.py:196 in get_typed_signature                                   │
│                                                                                                                                                                           │
│    193                                                                                                                                                                    │
│    194 def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:                                                                                            │
│    195 │   if sys.version_info >= (3, 10):                                                                                                                                │
│ ❱  196 │   │   signature = inspect.signature(call, eval_str=True)                                                                                                         │
│    197 │   else:                                                                                                                                                          │
│    198 │   │   signature = inspect.signature(call)                                                                                                                        │
│    199 │   unwrapped = inspect.unwrap(call)                                                                                                                               │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/inspect.py:3321 in signature                                                                             │
│                                                                                                                                                                           │
│   3318 def signature(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=False,    ╭─────────────── locals ────────────────╮                                 │
│   3319 │   │   │     annotation_format=Format.VALUE):                                           │ annotation_format = <Format.VALUE: 1> │                                 │
│   3320 │   """Get a signature object for the passed callable."""                                │          eval_str = True              │                                 │
│ ❱ 3321 │   return Signature.from_callable(obj, follow_wrapped=follow_wrapped,                   │    follow_wrapped = True              │                                 │
│   3322 │   │   │   │   │   │   │   │      globals=globals, locals=locals, eval_str=eval_str,    │           globals = None              │                                 │
│   3323 │   │   │   │   │   │   │   │      annotation_format=annotation_format)                  │            locals = None              │                                 │
│   3324                                                                                          ╰───────────────────────────────────────╯                                 │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/inspect.py:3036 in from_callable                                                                         │
│                                                                                                                                                                           │
│   3033 │   │   │   │   │     follow_wrapped=True, globals=None, locals=None, eval_str=False,    ╭─────────────── locals ────────────────╮                                 │
│   3034 │   │   │   │   │     annotation_format=Format.VALUE):                                   │ annotation_format = <Format.VALUE: 1> │                                 │
│   3035 │   │   """Constructs Signature for the given callable object."""                        │          eval_str = True              │                                 │
│ ❱ 3036 │   │   return _signature_from_callable(obj, sigcls=cls,                                 │    follow_wrapped = True              │                                 │
│   3037 │   │   │   │   │   │   │   │   │   │   follow_wrapper_chains=follow_wrapped,            │           globals = None              │                                 │
│   3038 │   │   │   │   │   │   │   │   │   │   globals=globals, locals=locals,                  │            locals = None              │                                 │
│        eval_str=eval_str,                                                                       ╰───────────────────────────────────────╯                                 │
│   3039 │   │   │   │   │   │   │   │   │   │   annotation_format=annotation_format)                                                                                       │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/inspect.py:2511 in _signature_from_callable                                                              │
│                                                                                                                                                                           │
│   2508 │   if isfunction(obj) or _signature_is_functionlike(obj):                                                                                                         │
│   2509 │   │   # If it's a pure Python function, or an object that is duck type                                                                                           │
│   2510 │   │   # of a Python function (Cython functions, for instance), then:                                                                                             │
│ ❱ 2511 │   │   return _signature_from_function(sigcls, obj,                                                                                                               │
│   2512 │   │   │   │   │   │   │   │   │   │   skip_bound_arg=skip_bound_arg,                                                                                             │
│   2513 │   │   │   │   │   │   │   │   │   │   globals=globals, locals=locals,                                                                                            │
│        eval_str=eval_str,                                                                                                                                                 │
│   2514 │   │   │   │   │   │   │   │   │   │   annotation_format=annotation_format)                                                                                       │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │     _get_signature_of = functools.partial(<function _signature_from_callable at 0x7c1ae7575640>, follow_wrapper_chains=True, skip_bound_arg=True, globals=None,       │ │
│ │                         locals=None, sigcls=<class 'inspect.Signature'>, eval_str=True, annotation_format=<Format.VALUE: 1>)                                          │ │
│ │     annotation_format = <Format.VALUE: 1>                                                                                                                             │ │
│ │              eval_str = True                                                                                                                                          │ │
│ │ follow_wrapper_chains = True                                                                                                                                          │ │
│ │               globals = None                                                                                                                                          │ │
│ │                locals = None                                                                                                                                          │ │
│ │        skip_bound_arg = True                                                                                                                                          │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/inspect.py:2334 in _signature_from_function                                                              │
│                                                                                                                                                                           │
│   2331 │   positional = arg_names[:pos_count]                                                                                                                             │
│   2332 │   keyword_only_count = func_code.co_kwonlyargcount                                                                                                               │
│   2333 │   keyword_only = arg_names[pos_count:pos_count + keyword_only_count]                                                                                             │
│ ❱ 2334 │   annotations = get_annotations(func, globals=globals, locals=locals,                                                                                            │
│        eval_str=eval_str,                                                                                                                                                 │
│   2335 │   │   │   │   │   │   │   │     format=annotation_format)                                                                                                        │
│   2336 │   defaults = func.__defaults__                                                                                                                                   │
│   2337 │   kwdefaults = func.__kwdefaults__                                                                                                                               │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │  annotation_format = <Format.VALUE: 1>                                                                                                                                │ │
│ │          arg_names = ()                                                                                                                                               │ │
│ │           eval_str = True                                                                                                                                             │ │
│ │          func_code = <code object get_noauth_strategy at 0x7c1ae1351a70, file                                                                                         │ │
│ │                      "/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fps_auth/backends.py", line 87>                                  │ │
│ │            globals = None                                                                                                                                             │ │
│ │   is_duck_function = False                                                                                                                                            │ │
│ │       keyword_only = ()                                                                                                                                               │ │
│ │ keyword_only_count = 0                                                                                                                                                │ │
│ │             locals = None                                                                                                                                             │ │
│ │          pos_count = 0                                                                                                                                                │ │
│ │         positional = ()                                                                                                                                               │ │
│ │      posonly_count = 0                                                                                                                                                │ │
│ │                  s = None                                                                                                                                             │ │
│ │     skip_bound_arg = True                                                                                                                                             │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                           │
│ /home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/annotationlib.py:1058 in get_annotations                                                                 │
│                                                                                                                                                                           │
│   1055 │                                                                                                                                                                  │
│   1056 │   return_value = {                                                                                                                                               │
│   1057 │   │   key: value if not isinstance(value, str)                                                                                                                   │
│ ❱ 1058 │   │   else eval(_rewrite_star_unpack(value), globals, locals)                                                                                                    │
│   1059 │   │   for key, value in ann.items()                                                                                                                              │
│   1060 │   }                                                                                                                                                              │
│   1061 │   return return_value                                                                                                                                            │
│                                                                                                                                                                           │
│ ╭─────────────────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────────────────╮ │
│ │         ann = {'return': 'NoAuthStrategy'}                                                                                                                            │ │
│ │    eval_str = True                                                                                                                                                    │ │
│ │      format = <Format.VALUE: 1>                                                                                                                                       │ │
│ │   functools = <module 'functools' from '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/functools.py'>                                               │ │
│ │     globals = {                                                                                                                                                       │ │
│ │               │   '__name__': 'fps_auth.backends',                                                                                                                    │ │
│ │               │   '__doc__': None,                                                                                                                                    │ │
│ │               │   '__package__': 'fps_auth',                                                                                                                          │ │
│ │               │   '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7c1ae132f950>,                                                               │ │
│ │               │   '__spec__': ModuleSpec(name='fps_auth.backends', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7c1ae132f950>,                     │ │
│ │               origin='/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fps_auth/backends.py'),                                          │ │
│ │               │   '__file__': '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/f'+19,                                                  │ │
│ │               │   '__cached__': '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/f'+44,                                                │ │
│ │               │   '__builtins__': {                                                                                                                                   │ │
│ │               │   │   '__name__': 'builtins',                                                                                                                         │ │
│ │               │   │   '__doc__': 'Built-in functions, types, exceptions, and other objects.\n\nThis module provides '+346,                                            │ │
│ │               │   │   '__package__': '',                                                                                                                              │ │
│ │               │   │   '__loader__': <class '_frozen_importlib.BuiltinImporter'>,                                                                                      │ │
│ │               │   │   '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'),                                 │ │
│ │               │   │   '__build_class__': <built-in function __build_class__>,                                                                                         │ │
│ │               │   │   '__import__': <built-in function __import__>,                                                                                                   │ │
│ │               │   │   'abs': <built-in function abs>,                                                                                                                 │ │
│ │               │   │   'all': <built-in function all>,                                                                                                                 │ │
│ │               │   │   'any': <built-in function any>,                                                                                                                 │ │
│ │               │   │   ... +149                                                                                                                                        │ │
│ │               │   },                                                                                                                                                  │ │
│ │               │   'annotations': _Feature((3, 7, 0, 'beta', 1), None, 16777216),                                                                                      │ │
│ │               │   'uuid': <module 'uuid' from '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/uuid.py'>,                                            │ │
│ │               │   ... +30                                                                                                                                             │ │
│ │               }                                                                                                                                                       │ │
│ │      locals = None                                                                                                                                                    │ │
│ │ obj_globals = {                                                                                                                                                       │ │
│ │               │   '__name__': 'fps_auth.backends',                                                                                                                    │ │
│ │               │   '__doc__': None,                                                                                                                                    │ │
│ │               │   '__package__': 'fps_auth',                                                                                                                          │ │
│ │               │   '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7c1ae132f950>,                                                               │ │
│ │               │   '__spec__': ModuleSpec(name='fps_auth.backends', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7c1ae132f950>,                     │ │
│ │               origin='/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fps_auth/backends.py'),                                          │ │
│ │               │   '__file__': '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/f'+19,                                                  │ │
│ │               │   '__cached__': '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/f'+44,                                                │ │
│ │               │   '__builtins__': {                                                                                                                                   │ │
│ │               │   │   '__name__': 'builtins',                                                                                                                         │ │
│ │               │   │   '__doc__': 'Built-in functions, types, exceptions, and other objects.\n\nThis module provides '+346,                                            │ │
│ │               │   │   '__package__': '',                                                                                                                              │ │
│ │               │   │   '__loader__': <class '_frozen_importlib.BuiltinImporter'>,                                                                                      │ │
│ │               │   │   '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'),                                 │ │
│ │               │   │   '__build_class__': <built-in function __build_class__>,                                                                                         │ │
│ │               │   │   '__import__': <built-in function __import__>,                                                                                                   │ │
│ │               │   │   'abs': <built-in function abs>,                                                                                                                 │ │
│ │               │   │   'all': <built-in function all>,                                                                                                                 │ │
│ │               │   │   'any': <built-in function any>,                                                                                                                 │ │
│ │               │   │   ... +149                                                                                                                                        │ │
│ │               │   },                                                                                                                                                  │ │
│ │               │   'annotations': _Feature((3, 7, 0, 'beta', 1), None, 16777216),                                                                                      │ │
│ │               │   'uuid': <module 'uuid' from '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/uuid.py'>,                                            │ │
│ │               │   ... +30                                                                                                                                             │ │
│ │               }                                                                                                                                                       │ │
│ │  obj_locals = None                                                                                                                                                    │ │
│ │ type_params = ()                                                                                                                                                      │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ in <module>:1                                                                                                                                                             │
│ ╭────────────────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────────────────╮           │
│ │ annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216)                                                                                                │           │
│ │       httpx = <module 'httpx' from '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/httpx/__init__.py'>                      │           │
│ │      models = <module 'fastapi_users.models' from '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/fastapi_users/models.py'> │           │
│ │      status = <module 'starlette.status' from '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/site-packages/starlette/status.py'>         │           │
│ │        uuid = <module 'uuid' from '/home/david/.local/share/mamba/envs/tmp-jupyverse/lib/python3.14/uuid.py'>                                               │           │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NameError: name 'NoAuthStrategy' is not defined

Copy link
Contributor

@davidbrochart davidbrochart Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing from __future__ import annotations in this file seems to solve the issue.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly seeing

src/hub_api/api/api_v1/endpoints/__init__.py:3: in <module>
    from hub_api.api.api_v1.endpoints import maintainers, plugins
src/hub_api/api/api_v1/endpoints/maintainers.py:15: in <module>
    @router.get(
.venv/lib/python3.14/site-packages/fastapi/routing.py:1072: in decorator
    self.add_api_route(
.venv/lib/python3.14/site-packages/fastapi/routing.py:1011: in add_api_route
    route = route_class(
.venv/lib/python3.14/site-packages/fastapi/routing.py:630: in __init__
    self.dependant = get_dependant(
.venv/lib/python3.14/site-packages/fastapi/dependencies/utils.py:290: in get_dependant
    sub_dependant = get_dependant(
.venv/lib/python3.14/site-packages/fastapi/dependencies/utils.py:259: in get_dependant
    endpoint_signature = get_typed_signature(call)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.14/site-packages/fastapi/dependencies/utils.py:196: in get_typed_signature
    signature = inspect.signature(call, eval_str=True)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/inspect.py:3312: in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
../../.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/inspect.py:3027: in from_callable
    return _signature_from_callable(obj, sigcls=cls,
../../.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/inspect.py:2502: in _signature_from_callable
    return _signature_from_function(sigcls, obj,
../../.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/inspect.py:2325: in _signature_from_function
    annotations = get_annotations(func, globals=globals, locals=locals, eval_str=eval_str,
../../.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/annotationlib.py:990: in get_annotations
    key: value if not isinstance(value, str) else eval(value, globals, locals)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<string>:1: in <module>
    ???
E   NameError: name 'AsyncGenerator' is not defined

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwrapped = inspect.unwrap(call)
globalns = getattr(unwrapped, "__globals__", {})
typed_params = [
Expand All @@ -217,7 +221,10 @@ def get_typed_annotation(annotation: Any, globalns: Dict[str, Any]) -> Any:


def get_typed_return_annotation(call: Callable[..., Any]) -> Any:
signature = inspect.signature(call)
if sys.version_info >= (3, 10):
signature = inspect.signature(call, eval_str=True)
else:
signature = inspect.signature(call)
unwrapped = inspect.unwrap(call)
annotation = signature.return_annotation

Expand Down
26 changes: 26 additions & 0 deletions tests/test_stringified_annotations_simple.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from __future__ import annotations

from fastapi import Depends, FastAPI, Request
from fastapi.testclient import TestClient
from typing_extensions import Annotated

from .utils import needs_py310


class Dep:
def __call__(self, request: Request):
return "test"


@needs_py310
def test_stringified_annotations():
app = FastAPI()

client = TestClient(app)

@app.get("/test/")
def call(test: Annotated[str, Depends(Dep())]):
return {"test": test}

response = client.get("/test")
assert response.status_code == 200