-
-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(debugger): passing debugger to app #3967
base: main
Are you sure you want to change the base?
Conversation
…ost_mortem() protocol
…ost_mortem() protocol
…pdate import statements
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3967 +/- ##
=======================================
Coverage 98.34% 98.35%
=======================================
Files 347 348 +1
Lines 15743 15793 +50
Branches 1740 1745 +5
=======================================
+ Hits 15483 15533 +50
Misses 124 124
Partials 136 136 ☔ View full report in Codecov by Sentry. |
litestar/types/debugger_types.py
Outdated
) -> Optional[NoReturn]: ... | ||
|
||
|
||
Debugger: TypeAlias = Union[ModuleType, PDBProtocol, IPDBProtocol, PDBRProtocol, PUDBProtocol] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure either but the tying pros here will kmow _)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just have the post_mortem
as
@staticmethod
def post_mortem(
traceback: TracebackType | None = None,
*args: Any,
**kwargs: Any,
) -> Any: ...
instead of an exact match for every single one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just have the
post_mortem
as@staticmethod def post_mortem( traceback: TracebackType | None = None, *args: Any, **kwargs: Any, ) -> Any: ...instead of an exact match for every single one?
thought about it, these methods have different signatures, and I don't like "Any" much, maybe your solution is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@provinzkraut your solution works fine, should i change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please
got u
@sobolevn I'd like if you review me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor comments on my side, though I wasnt able to be sent into pdb on an exception, is it working or im doing something stupid ?
using this app:
import pdb
import uvicorn
from litestar import Litestar, get
@get("/")
async def exc() -> str:
1 / 0
return "Hello World"
app = Litestar(route_handlers=[exc], debugger_module=pdb, debug=True)
if __name__ == "__main__":
uvicorn.run(
"qq:app",
reload=True,
)
ok answering to myself why I couldnt pop in pdb, it is because requires |
Yeah, you're right, ty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks !
Co-authored-by: Janek Nouvertné <[email protected]>
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3967 |
Description
Passing
debugger_module
variable to apppost_mortem
methodCloses
#3949