From cbac633ab30f3b3e4e836ff87a3a88a28bffca48 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 20 Oct 2020 15:03:28 +0100 Subject: [PATCH] version bump --- pyproject.toml | 4 ++-- tools/profile_pretty.py | 4 +++- tools/stress_test_pretty.py | 8 ++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6a9d7447..95a1fe02 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 = "9.0.0" +version = "9.0.1" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" authors = ["Will McGugan "] license = "MIT" @@ -39,4 +39,4 @@ jupyter = ["ipywidgets"] [build-system] requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" \ No newline at end of file +build-backend = "poetry.core.masonry.api" diff --git a/tools/profile_pretty.py b/tools/profile_pretty.py index 73033406..c1a08b82 100644 --- a/tools/profile_pretty.py +++ b/tools/profile_pretty.py @@ -11,11 +11,13 @@ with open("cats.json") as fh: cats = json.load(fh) +console.begin_capture() start = time() pretty = Pretty(cats) console.print(pretty, overflow="ignore", crop=False) +result = console.end_capture() taken = (time() - start) * 1000 - +print(result) print(console.file.getvalue()) print(f"{taken:.1f}") diff --git a/tools/stress_test_pretty.py b/tools/stress_test_pretty.py index cd9d5202..8f428ca6 100644 --- a/tools/stress_test_pretty.py +++ b/tools/stress_test_pretty.py @@ -5,6 +5,14 @@ from rich.pretty import Pretty DATA = { "foo": [1, 2, 3, (), {}, (1, 2, 3), {4, 5, 6, (7, 8, 9)}, "Hello, World"], "bar": [None, (False, True)] * 2, + "Dune": { + "names": { + "Paul Atriedies", + "Vladimir Harkonnen", + "Thufir Haway", + "Duncan Idaho", + } + }, } console = Console() for w in range(130):