Skip to content
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 option to set the width of the Rich exception output #528

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

indiVar0508
Copy link

add parameter as suggested feature in issue #523

@github-actions
Copy link

github-actions bot commented Jan 7, 2023

📝 Docs preview for commit d82e751 at: https://63b9cedb2674445f42edea4e--typertiangolo.netlify.app

@github-actions
Copy link

github-actions bot commented Feb 2, 2023

📝 Docs preview for commit 36405da at: https://63dba78174f4db37545e5176--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 0e54ace at: https://63ef5180d07132579c80cd4c--typertiangolo.netlify.app

@github-actions
Copy link

github-actions bot commented Mar 4, 2023

📝 Docs preview for commit 7814341 at: https://64034f719f540d3ebc0ef662--typertiangolo.netlify.app

@indiVar0508
Copy link
Author

Hi @tiangolo ,
Did you get a chance to review this PR

@Napo2k
Copy link

Napo2k commented Feb 12, 2024

I definitely would like for this to be merged in! @tiangolo

@svlandeg svlandeg added feature New feature, enhancement or request p3 labels Mar 1, 2024
@nikita-b
Copy link

Yes, feature looks really good. @tiangolo Could you please, review?

adding new attribute in DeveloperExceptionConfig to allow
setting width for rick traceback.
add `pretty_exceptions_width` in typer class to be used by
`DeveloperConfigException` to allow setting width of traceback
boxes.
@svlandeg svlandeg changed the title Add #523 ✨ Add a new parameter to set the width of the Rich exception output Apr 18, 2024
Copy link

📝 Docs preview for commit 0460e47 at: https://293c1362.typertiangolo.pages.dev

@svlandeg svlandeg changed the title ✨ Add a new parameter to set the width of the Rich exception output ✨ Add option to set the width of the Rich exception output Apr 18, 2024
Copy link

📝 Docs preview for commit 6d87cfd at: https://126b3831.typertiangolo.pages.dev

Copy link

📝 Docs preview for commit cb05984 at: https://e1850eae.typertiangolo.pages.dev

Copy link

📝 Docs preview for commit 45e9736 at: https://d38a79ef.typertiangolo.pages.dev

Copy link

github-actions bot commented Aug 9, 2024

@svlandeg svlandeg self-assigned this Aug 9, 2024
@svlandeg
Copy link
Member

svlandeg commented Aug 9, 2024

Merging in the latest from master has made the CI on this PR fail - I'm looking into it.

[UPDATE]: fixed 🎉

@svlandeg svlandeg marked this pull request as draft August 9, 2024 09:10
Copy link

github-actions bot commented Aug 9, 2024

@svlandeg svlandeg removed their assignment Aug 9, 2024
@svlandeg svlandeg marked this pull request as ready for review August 9, 2024 10:03
@thejevans
Copy link

If this is going to be added, it would be great if all options available to rich.traceback.install could be used, maybe as a dict parameter instead of a parameter for each one.

@svlandeg
Copy link
Member

There's a recently merged PR that has conflicting behaviour for the setting of width in Traceback.from_exception - I'll look into it.

@svlandeg svlandeg self-assigned this Aug 26, 2024
@svlandeg svlandeg marked this pull request as draft August 26, 2024 09:31
Copy link

Copy link

Copy link

@svlandeg
Copy link
Member

Ok, so there has been a related PR that was recently merged and that unifies the width of the Rich console for help and errors.

On the new master, this is then the output of the scripts as mentioned above:

image

i.e. the error message takes up the full width of the console, which is already better than the original situation described here.

Nonetheless, I still think it can be interesting to have this as a user-adjustable setting. So, I've merged the functionality from both PRs by setting the default of pretty_exceptions_width to rich_utils.MAX_WIDTH if available, and 100 otherwise.

Copy link

Copy link

@svlandeg svlandeg marked this pull request as ready for review August 27, 2024 13:00
@svlandeg svlandeg removed their assignment Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature, enhancement or request p3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New setting to increase the width of the rich (exception) output
5 participants