Skip to content

Added support for Rich Repr protocol#3099

Merged
samuelcolvin merged 7 commits intopydantic:masterfrom
willmcgugan:master
Aug 4, 2022
Merged

Added support for Rich Repr protocol#3099
samuelcolvin merged 7 commits intopydantic:masterfrom
willmcgugan:master

Conversation

@willmcgugan
Copy link
Copy Markdown
Contributor

@willmcgugan willmcgugan commented Aug 15, 2021

Change Summary

Adds support for the Rich Repr Protocol so that Rich can pretty print PyDantic objects.

Screen Shot 2021-08-15 at 14 13 35

Note that Rich does not need to be added a dependency. If PyDantic objects are printed with Rich you will get the formatting above, otherwise there are no changes.

Related issue number

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@willmcgugan
Copy link
Copy Markdown
Contributor Author

please review

Not sure if this change warrants any update to the docs. If anything, maybe a sentence or two max, but where?

@samuelcolvin
Copy link
Copy Markdown
Member

Thanks so much.

When life is less manic I'll review and merge.

Copy link
Copy Markdown
Collaborator

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

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

You could probably add a note under Usage with devtools (e.g. Usage with rich) with just a screenshot and a link to rich. WDYT?

@PrettyWood
Copy link
Copy Markdown
Collaborator

Please update

@github-actions github-actions bot added awaiting author revision awaiting changes from the PR author and removed ready for review labels Sep 4, 2021
willmcgugan and others added 2 commits September 7, 2021 14:51
Adds code to markdown

Co-authored-by: Eric Jolibois <[email protected]>
@willmcgugan
Copy link
Copy Markdown
Contributor Author

@PrettyWood Added a Usage with rich page as suggested. Here's what it looks like:

Screen Shot 2021-09-07 at 15 19 04

@PrettyWood PrettyWood removed the awaiting author revision awaiting changes from the PR author label Sep 7, 2021
@PrettyWood
Copy link
Copy Markdown
Collaborator

Looks great! Thank you 🙏 (big fan of your work btw)

@manzt
Copy link
Copy Markdown

manzt commented Feb 4, 2022

Love rich and pydantic, hope this gets merged!

@soumendra
Copy link
Copy Markdown

Great work. Hopefully we'll see this in the next pydantic release?

@samuelcolvin samuelcolvin enabled auto-merge (squash) August 4, 2022 13:38
@samuelcolvin
Copy link
Copy Markdown
Member

Thanks so much @willmcgugan, much appreciated.

Sorry this has taken so long to get to.

@samuelcolvin samuelcolvin merged commit e58dad6 into pydantic:master Aug 4, 2022
@willmcgugan
Copy link
Copy Markdown
Contributor Author

Thanks @samuelcolvin !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants