Skip to content

Commit

Permalink
Merge pull request #1819 from Textualize/deprecate-render-group
Browse files Browse the repository at this point in the history
Render Group
  • Loading branch information
willmcgugan committed Jan 9, 2022
2 parents d65c3bd + ad9debf commit 44a715d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Expand Up @@ -5,7 +5,6 @@ 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).


## [11.0.0] - Unreleased

### Added
Expand All @@ -14,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added max_depth arg to pretty printing
- Fix Traceback theme defaults override user supplied styles https://github.com/Textualize/rich/issues/1786

### Changed

- **breaking** Deprecated rich.console.RenderGroup, now named rich.console.Group

## [10.16.2] - 2021-01-02

### Fixed
Expand Down
17 changes: 6 additions & 11 deletions rich/console.py
Expand Up @@ -11,9 +11,9 @@
from html import escape
from inspect import isclass
from itertools import islice
from time import monotonic
from threading import RLock
from types import FrameType, TracebackType, ModuleType
from time import monotonic
from types import FrameType, ModuleType, TracebackType
from typing import (
IO,
TYPE_CHECKING,
Expand Down Expand Up @@ -258,11 +258,12 @@ def __rich_console__(
...


# A type that may be rendered by Console.
RenderableType = Union[ConsoleRenderable, RichCast, str]
"""A type that may be rendered by Console."""


# The result of calling a __rich_console__ method.
RenderResult = Iterable[Union[RenderableType, Segment]]
"""The result of calling a __rich_console__ method."""


_null_highlighter = NullHighlighter()
Expand Down Expand Up @@ -475,9 +476,6 @@ def __rich_console__(
yield from self.renderables


RenderGroup = Group # TODO: deprecate at some point


def group(fit: bool = True) -> Callable[..., Callable[..., Group]]:
"""A decorator that turns an iterable of renderables in to a group.
Expand All @@ -488,7 +486,7 @@ def group(fit: bool = True) -> Callable[..., Callable[..., Group]]:
def decorator(
method: Callable[..., Iterable[RenderableType]]
) -> Callable[..., Group]:
"""Convert a method that returns an iterable of renderables in to a RenderGroup."""
"""Convert a method that returns an iterable of renderables in to a Group."""

@wraps(method)
def _replace(*args: Any, **kwargs: Any) -> Group:
Expand All @@ -500,9 +498,6 @@ def _replace(*args: Any, **kwargs: Any) -> Group:
return decorator


render_group = group


def _is_jupyter() -> bool: # pragma: no cover
"""Check if we're running in a Jupyter notebook."""
try:
Expand Down

0 comments on commit 44a715d

Please sign in to comment.