Skip to content

feat(debugger): passing debugger to app#3967

Merged
provinzkraut merged 21 commits intolitestar-org:mainfrom
oek1ng:passing-debugger-to-app
Feb 25, 2025
Merged

feat(debugger): passing debugger to app#3967
provinzkraut merged 21 commits intolitestar-org:mainfrom
oek1ng:passing-debugger-to-app

Conversation

@oek1ng
Copy link
Copy Markdown
Contributor

@oek1ng oek1ng commented Jan 23, 2025

Description

Passing debugger_module variable to app

  • Added type for pdb-like module, which supports post_mortem method
  • Added debugger test app
  • Added doc

Closes

#3949

@oek1ng oek1ng requested review from a team as code owners January 23, 2025 08:01
@github-actions github-actions bot added area/docs This PR involves changes to the documentation area/private-api This PR involves changes to the privatized API area/types This PR involves changes to the custom types size: small pr/external Triage Required 🏥 This requires triage labels Jan 23, 2025
@oek1ng oek1ng changed the title Passing debugger to app feat(debugger): passing debugger to app Jan 23, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.35%. Comparing base (12d0e8f) to head (e07f5a7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3967   +/-   ##
=======================================
  Coverage   98.35%   98.35%           
=======================================
  Files         347      348    +1     
  Lines       15811    15821   +10     
  Branches     1747     1747           
=======================================
+ Hits        15551    15561   +10     
  Misses        124      124           
  Partials      136      136           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added area/dependencies This PR involves changes to the dependencies and removed size: small labels Jan 23, 2025
@oek1ng
Copy link
Copy Markdown
Contributor Author

oek1ng commented Jan 26, 2025

@sobolevn I'd like if you review me

Copy link
Copy Markdown
Contributor

@euri10 euri10 left a 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,
    )

20250126_1011_2117x1270_1737882686

@euri10
Copy link
Copy Markdown
Contributor

euri10 commented Jan 26, 2025

ok answering to myself why I couldnt pop in pdb, it is because requires pdb_on_exception=True so I think the docs should show a "working" example.

@oek1ng
Copy link
Copy Markdown
Contributor Author

oek1ng commented Jan 26, 2025

ok answering to myself why I couldnt pop in pdb, it is because requires pdb_on_exception=True so I think the docs should show a "working" example.

Yeah, you're right, ty

Copy link
Copy Markdown
Contributor

@euri10 euri10 left a comment

Choose a reason for hiding this comment

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

LGTM thanks !

@provinzkraut provinzkraut force-pushed the passing-debugger-to-app branch from 0dfd519 to e07f5a7 Compare February 25, 2025 18:56
@provinzkraut provinzkraut enabled auto-merge (squash) February 25, 2025 18:56
@provinzkraut provinzkraut merged commit 2177560 into litestar-org:main Feb 25, 2025
26 checks passed
@github-actions
Copy link
Copy Markdown

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies This PR involves changes to the dependencies area/docs This PR involves changes to the documentation area/private-api This PR involves changes to the privatized API area/types This PR involves changes to the custom types pr/external pr/internal size: medium Triage Required 🏥 This requires triage type/feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants