From 7d02d29ba887c5c2b0203e0fb7e3c34cf1e14079 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 12 May 2021 18:18:17 +0100 Subject: [PATCH] attrs example, version bump --- CHANGELOG.md | 2 +- examples/attrs.py | 17 ++++++----------- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cdbc8d6..a385cf19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [10.2.0] - Unreleased +## [10.2.0] - 2021-05-12 ### Added diff --git a/examples/attrs.py b/examples/attrs.py index 4928405f..35746738 100644 --- a/examples/attrs.py +++ b/examples/attrs.py @@ -41,18 +41,13 @@ if __name__ == "__main__": ) from rich.console import Console + from rich.pretty import Pretty + from rich.table import Column, Table + from rich.text import Text console = Console() - console.print( - "\nRich can pretty print [b]attrs[/b] objects ( https://www.attrs.org/en/stable/ )\n", - justify="center", - ) + table = Table("attrs *with* Rich", Column(Text.from_markup("attrs *without* Rich"))) - console.rule("attrs without Rich") - - print(model) - - console.rule("attrs with Rich") - - console.print(model) + table.add_row(Pretty(model), repr(model)) + console.print(table) diff --git a/pyproject.toml b/pyproject.toml index 69f17e87..c6dd9901 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "rich" homepage = "https://github.com/willmcgugan/rich" documentation = "https://rich.readthedocs.io/en/latest/" -version = "10.1.0" +version = "10.2.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" authors = ["Will McGugan "] license = "MIT"