Skip to content

Commit b5d063c

Browse files
authored
Merge branch 'master' into highlight_regex_compiled
2 parents 03e574b + 68ead31 commit b5d063c

29 files changed

+359
-82
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ jobs:
66
build:
77
runs-on: ${{ matrix.os }}
88
strategy:
9+
fail-fast: false
910
matrix:
1011
os: [windows-latest, ubuntu-latest, macos-latest]
11-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
12-
include:
13-
- { os: ubuntu-latest, python-version: "3.7" }
14-
- { os: windows-latest, python-version: "3.7" }
15-
- { os: macos-12, python-version: "3.7" }
12+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
13+
exclude:
14+
- { os: windows-latest, python-version: "3.13" }
1615
defaults:
1716
run:
1817
shell: bash
@@ -22,6 +21,7 @@ jobs:
2221
uses: actions/setup-python@v5
2322
with:
2423
python-version: ${{ matrix.python-version }}
24+
allow-prereleases: true
2525
- name: Install and configure Poetry
2626
# TODO: workaround for https://github.com/snok/install-poetry/issues/94
2727
uses: snok/install-poetry@v1.3.4

CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,32 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
98
## Unreleased
109

10+
11+
### Changed
12+
13+
- Rich will display tracebacks with finely grained error locations on python 3.11+ https://github.com/Textualize/rich/pull/3486
14+
15+
16+
### Fixed
17+
18+
- Fixed issue with Segment._split_cells https://github.com/Textualize/rich/pull/3506
19+
- Fix auto detection of terminal size on Windows https://github.com/Textualize/rich/pull/2916
20+
21+
### Added
22+
23+
- Add a new `column` object `IterationSpeedColumn`. https://github.com/Textualize/rich/pull/3332
24+
25+
## [13.8.1] - 2024-09-10
26+
27+
### Fixed
28+
29+
- Added support for Python 3.13 https://github.com/Textualize/rich/pull/3481
30+
- Fixed infinite loop when appending Text to same instance https://github.com/Textualize/rich/pull/3480
31+
32+
## [13.8.0] - 2024-08-26
33+
1134
### Fixed
1235

1336
- Fixed `Table` rendering of box elements so "footer" elements truly appear at bottom of table, "mid" elements in main table body.
@@ -17,8 +40,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1740
- Progress track thread is now a daemon thread https://github.com/Textualize/rich/pull/3402
1841
- Fixed cached hash preservation upon clearing meta and links https://github.com/Textualize/rich/issues/2942
1942
- Fixed overriding the `background_color` of `Syntax` not including padding https://github.com/Textualize/rich/issues/3295
43+
- Fixed pretty printing of dataclasses with a default repr in Python 3.13 https://github.com/Textualize/rich/pull/3455
2044
- Fixed selective enabling of highlighting when disabled in the `Console` https://github.com/Textualize/rich/issues/3419
2145
- Fixed BrokenPipeError writing an error message https://github.com/Textualize/rich/pull/3468
46+
- Fixed superfluous space above Markdown tables https://github.com/Textualize/rich/pull/3469
47+
- Fixed issue with record and capture interaction https://github.com/Textualize/rich/pull/3470
48+
- Fixed control codes breaking in `append_tokens` https://github.com/Textualize/rich/pull/3471
49+
- Fixed exception pretty printing a dataclass with missing fields https://github.com/Textualize/rich/pull/3472
2250

2351
### Changed
2452

@@ -42,6 +70,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4270

4371
- Updated the widths of some characters https://github.com/Textualize/rich/pull/3289
4472

73+
### Added
74+
75+
- Included a `name` attribute to the `Spinner` class https://github.com/Textualize/rich/pull/3359
76+
4577
## [13.7.0] - 2023-11-15
4678

4779
### Added
@@ -2056,6 +2088,8 @@ Major version bump for a breaking change to `Text.stylize signature`, which corr
20562088

20572089
- First official release, API still to be stabilized
20582090

2091+
[13.8.1]: https://github.com/textualize/rich/compare/v13.8.0...v13.8.1
2092+
[13.8.0]: https://github.com/textualize/rich/compare/v13.7.1...v13.8.0
20592093
[13.7.1]: https://github.com/textualize/rich/compare/v13.7.0...v13.7.1
20602094
[13.7.0]: https://github.com/textualize/rich/compare/v13.6.0...v13.7.0
20612095
[13.6.0]: https://github.com/textualize/rich/compare/v13.5.3...v13.6.0

CONTRIBUTORS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The following people have contributed to the development of Rich:
2020
- [Aryaz Eghbali](https://github.com/AryazE)
2121
- [Oleksis Fraga](https://github.com/oleksis)
2222
- [Andy Gimblett](https://github.com/gimbo)
23+
- [Kai Giokas](https://github.com/kaisforza)
2324
- [Tom Gooding](https://github.com/TomJGooding)
2425
- [Michał Górny](https://github.com/mgorny)
2526
- [Nok Lam Chan](https://github.com/noklam)
@@ -63,6 +64,7 @@ The following people have contributed to the development of Rich:
6364
- [Tushar Sadhwani](https://github.com/tusharsadhwani)
6465
- [Luca Salvarani](https://github.com/LukeSavefrogs)
6566
- [Paul Sanders](https://github.com/sanders41)
67+
- [Louis Sautier](https://github.com/sbraz)
6668
- [Tim Savage](https://github.com/timsavage)
6769
- [Anthony Shaw](https://github.com/tonybaloney)
6870
- [Nicolas Simonds](https://github.com/0xDEC0DE)
@@ -86,3 +88,6 @@ The following people have contributed to the development of Rich:
8688
- [Bernhard Wagner](https://github.com/bwagner)
8789
- [Aaron Beaudoin](https://github.com/AaronBeaudoin)
8890
- [Sam Woodward](https://github.com/PyWoody)
91+
- [L. Yeung](https://github.com/lewis-yeung)
92+
- [chthollyphile](https://github.com/chthollyphile)
93+
- [Jonathan Helmus](https://github.com/jjhelmus)

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
alabaster==0.7.12
1+
alabaster==1.0.0
22
Sphinx==7.3.7
33
sphinx-rtd-theme==2.0.0
44
sphinx-copybutton==0.5.1

docs/source/progress.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Columns
131131

132132
You may customize the columns in the progress display with the positional arguments to the :class:`~rich.progress.Progress` constructor. The columns are specified as either a `format string <https://docs.python.org/3/library/string.html#formatspec>`_ or a :class:`~rich.progress.ProgressColumn` object.
133133

134-
Format strings will be rendered with a single value `"task"` which will be a :class:`~rich.progress.Task` instance. For example ``"{task.description}"`` would display the task description in the column, and ``"{task.completed} of {task.total}"`` would display how many of the total steps have been completed. Additional fields passed via keyword arguments to `~rich.progress.Progress.update` are store in ``task.fields``. You can add them to a format string with the following syntax: ``"extra info: {task.fields[extra]}"``.
134+
Format strings will be rendered with a single value `"task"` which will be a :class:`~rich.progress.Task` instance. For example ``"{task.description}"`` would display the task description in the column, and ``"{task.completed} of {task.total}"`` would display how many of the total steps have been completed. Additional fields passed via keyword arguments to `~rich.progress.Progress.update` are stored in ``task.fields``. You can add them to a format string with the following syntax: ``"extra info: {task.fields[extra]}"``.
135135

136136
The default columns are equivalent to the following::
137137

@@ -163,6 +163,7 @@ The following column objects are available:
163163
- :class:`~rich.progress.TransferSpeedColumn` Displays transfer speed (assumes the steps are bytes).
164164
- :class:`~rich.progress.SpinnerColumn` Displays a "spinner" animation.
165165
- :class:`~rich.progress.RenderableColumn` Displays an arbitrary Rich renderable in the column.
166+
- :class:`~rich.progress.IterationSpeedColumn` Displays iteration speed in it/s (iterations per second).
166167

167168
To implement your own columns, extend the :class:`~rich.progress.ProgressColumn` class and use it as you would the other columns.
168169

examples/downloader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def download(urls: Iterable[str], dest_dir: str):
7373

7474

7575
if __name__ == "__main__":
76-
# Try with https://releases.ubuntu.com/20.04/ubuntu-20.04.3-desktop-amd64.iso
76+
# Try with https://releases.ubuntu.com/noble/ubuntu-24.04-desktop-amd64.iso
77+
# and https://releases.ubuntu.com/noble/ubuntu-24.04-live-server-amd64.iso
7778
if sys.argv[1:]:
7879
download(sys.argv[1:], "./")
7980
else:

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "rich"
33
homepage = "https://github.com/Textualize/rich"
44
documentation = "https://rich.readthedocs.io/en/latest/"
5-
version = "13.7.1"
5+
version = "13.8.1"
66
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
77
authors = ["Will McGugan <willmcgugan@gmail.com>"]
88
license = "MIT"
@@ -21,6 +21,7 @@ classifiers = [
2121
"Programming Language :: Python :: 3.10",
2222
"Programming Language :: Python :: 3.11",
2323
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
2425
"Typing :: Typed",
2526
]
2627
include = ["rich/py.typed"]

rich/console.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,19 +1005,13 @@ def size(self) -> ConsoleDimensions:
10051005
width: Optional[int] = None
10061006
height: Optional[int] = None
10071007

1008-
if WINDOWS: # pragma: no cover
1008+
for file_descriptor in _STD_STREAMS_OUTPUT if WINDOWS else _STD_STREAMS:
10091009
try:
1010-
width, height = os.get_terminal_size()
1010+
width, height = os.get_terminal_size(file_descriptor)
10111011
except (AttributeError, ValueError, OSError): # Probably not a terminal
10121012
pass
1013-
else:
1014-
for file_descriptor in _STD_STREAMS:
1015-
try:
1016-
width, height = os.get_terminal_size(file_descriptor)
1017-
except (AttributeError, ValueError, OSError):
1018-
pass
1019-
else:
1020-
break
1013+
else:
1014+
break
10211015

10221016
columns = self._environ.get("COLUMNS")
10231017
if columns is not None and columns.isdigit():
@@ -2029,7 +2023,7 @@ def _write_buffer(self) -> None:
20292023
"""Write the buffer to the output file."""
20302024

20312025
with self._lock:
2032-
if self.record:
2026+
if self.record and not self._buffer_index:
20332027
with self._record_buffer_lock:
20342028
self._record_buffer.extend(self._buffer[:])
20352029

rich/default_styles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
"traceback.exc_type": Style(color="bright_red", bold=True),
121121
"traceback.exc_value": Style.null(),
122122
"traceback.offset": Style(color="bright_red", bold=True),
123+
"traceback.error_range": Style(underline=True, bold=True, dim=False),
123124
"bar.back": Style(color="grey23"),
124125
"bar.complete": Style(color="rgb(249,38,114)"),
125126
"bar.finished": Style(color="rgb(114,156,31)"),

0 commit comments

Comments
 (0)