FastAPI-template icon indicating copy to clipboard operation
FastAPI-template copied to clipboard

mypy errors in fastapi_users

Open WurgBASH opened this issue 1 year ago • 1 comments
trafficstars

Hi, I created project with fastapi_users and I've been getting mypy errors since the beginning. Does anyone know how to fix it?

my_project/web/api/users/views.py:3: error: Module "my_project.db.models.users" has no attribute "UserCreate" [attr-defined] from my_project.db.models.users import ( ^ my_project/web/api/users/views.py:3: error: Module "my_project.db.models.users" has no attribute "UserRead" [attr-defined] from my_project.db.models.users import ( ^ my_project/web/api/users/views.py:3: error: Module "my_project.db.models.users" has no attribute "UserUpdate" [attr-defined] from my_project.db.models.users import ( ^ my_project/web/api/users/views.py:3: error: Module "my_project.db.models.users" has no attribute "api_users" [attr-defined] from my_project.db.models.users import ( ^ my_project/web/api/users/views.py:3: error: Module "my_project.db.models.users" has no attribute "auth_cookie" [attr-defined] from psm_my_projectapi.db.models.users import ( ^ Found 5 errors in 1 file (checked 24 source files)

WurgBASH avatar Aug 05 '24 10:08 WurgBASH

used namespace_packages = false will fix the users but not fully sure why namespace package is weird

Evelina-Eevee avatar Sep 16 '24 11:09 Evelina-Eevee

got the same error

ZackEndboss avatar Apr 04 '25 16:04 ZackEndboss

Can you try using fix from above?

s3rius avatar Apr 04 '25 19:04 s3rius