-
-
Notifications
You must be signed in to change notification settings - Fork 810
✨ Add support for standard tracebacks via the env TYPER_STANDARD_TRACEBACK
#1299
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
✨ Add support for standard tracebacks via the env TYPER_STANDARD_TRACEBACK
#1299
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
TYPER_STANDARD_TRACEBACKTYPER_STANDARD_TRACEBACK
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.
As discussed, this PR adds the option to set an env var TYPER_STANDARD_TRACEBACK while still supporting the old var _TYPER_STANDARD_TRACEBACK too. We need to support both because we don't want to break existing workflows, but that does complicate the code slightly. I think that's an acceptable trade-off to ensure this variable can be properly set in AWS Lambda etc.
|
I will leave this PR for a final review by Tiangolo 🙏 |
tiangolo
left a comment
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.
Makes sense, thank you! 🚀
|
It seems that I can't push to your branch |
b77ece1 to
0a41362
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
@tiangolo I've updated and tests are now passing. |
|
Thanks @colin-nolan! I've moved this back to Tiangolo's internal review queue 😉 |
|
Waiting on @tiangolo |
This comment was marked as resolved.
This comment was marked as resolved.
|
@colin-nolan: can you please turn on the option that maintainers can edit this PR? |
Keeps support fo `_TYPER_STANDARD_TRACEBACK` but notes as deprecated because: - It is non-standard for an advertised env to start with an underscore. - Environment variables that start with an underscore have been observed as causing issues in some execution environments (e.g. with AWS Lambda). See: fastapi#1284
0a41362 to
a75d349
Compare
📝 Docs previewLast commit a75d349 at: https://55fbf697.typertiangolo.pages.dev Modified Pages |
|
@svlandeg I've resolved the merge conflict. I've tried to enable maintainers PR edits but, for some reason, the option to do this doesn't exist(?) (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) Edit: On reading the docs from GH again, I note (emphasis mine):
The fork is from a company account. Its ambiguous as to whether permission can be added post creation but that could well the be issue. |
|
Ok, thanks @colin-nolan! As Tiangolo had already approved earlier, and nothing changed since then other than merging in |

This PR allows standard tracebacks to be enabled using the environment variable:
TYPER_STANDARD_TRACEBACK.The work is a follow up to the discussion with @svlandeg: #1284.
The existing environment variable
_TYPER_STANDARD_TRACEBACKis retained but referred to as "deprecated" because:Manual testing with:
Produces expected results: