Hi all, started getting errors on the Controller after moving to mypy strict, any ideas what that may be? I think this was related to the explicit exports, although it does seem Litestar is normally exporting and defining the Controller, although the same error shows when importing from litestar import Controller and from litestar.controller import Controller. The error is Class cannot subclass Controller (has Any type) Any ideas?
#Mypy error when subclassing `Controller`
1 messages · Page 1 of 1 (latest)
Notes for Mypy error when subclassing `Controller`
At your assistance
@dire sonnet
No Response?
If no response in a reasonable time, ping @Member.
Closing
To close, type !solve or byte solve.
MCVE
Please include an MCVE so that we can reproduce your issue locally.
Can you do a simple check?
Create a check.py file:
from litestar import Controller
reveal_type(Controller)
```and run mypy against it
If that also outputs Any, something's wonky with your setup 😉
Yeah, something's is definitely wonky, just can;t find out what!
Forgot to mention, I did the test and it's "Any" indeed. Other interesting thing is that Mypy skips Litestar (mypy . --verbose --show-traceback):
LOG: Skipping /Users/myuser/Developer/myproj/myproj-api/.venv/lib/python3.11/site-packages/litestar/di.py (litestar.di)
LOG: Skipping /Users/myuser/Developer/myproj/myproj-api/.venv/lib/python3.11/site-packages/litestar/params.py (litestar.params)
LOG: Skipping /Users/myuser/Developer/myproj/myproj-api/.venv/lib/python3.11/site-packages/litestar/datastructures/__init__.py (litestar.datastructures)
LOG: Skipping /Users/myuser/Developer/myproj/myproj-api/.venv/lib/python3.11/site-packages/litestar/enums.py (litestar.enums)
Even though I have 2.14.0, and when manually inspecting i do see py.typed on the litestar package