Upgrading rich 13 to 14
Breaking13.9.4 → 14.3.4Breaking2New10Changed10Fixed13
BreakingUpgrade verdict
1 breaking change.
In plain terms
- Previously setting FORCE_COLOR to an empty value forced color on; now an empty value means the setting is ignored.
Must act 1 item needs code or config changes
What you must change
Breaking1
An empty FORCE_COLOR environment variable is now treated as disabled.
FORCE_COLORNO_COLORAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- changed:
function cached_cell_len(text: str) -> int → function cached_cell_len(text: str, unicode_version: str=…) -> int - changed:
function cell_len(text: str, _cell_len: Callable[[str], int]=…) -> int → function cell_len(text: str, unicode_version: str=…) -> int - changed:
function chop_cells(text: str, width: int) -> list[str] → function chop_cells(text: str, width: int, unicode_version: str=…) -> list[str] - changed:
function get_character_cell_size(character: str) -> int → function get_character_cell_size(character: str, unicode_version: str=…) -> int - changed:
function set_cell_size(text: str, total: int) -> str → function set_cell_size(text: str, total: int, unicode_version: str=…) -> str - added:
class CellTable(NamedTuple) - added:
field CellTable.narrow_to_wide: frozenset[str] - added:
field CellTable.unicode_version: str - added:
field CellTable.widths: Sequence[tuple[int, int, int]] - added:
function split_graphemes(text: str, unicode_version: str=…) -> tuple[list[CellSpan], int] - added:
function split_text(text: str, cell_position: int, unicode_version: str=…) -> tuple[str, str] - added:
variable CellSpan
- changed:
method Console.set_live(live: Live) -> None → method Console.set_live(live: Live) -> bool
- changed:
field ISO8601Highlighter.base_style → field ISO8601Highlighter.base_style: ClassVar[str] - changed:
field ISO8601Highlighter.highlights → field ISO8601Highlighter.highlights: ClassVar[Sequence[str]] - changed:
field JSONHighlighter.base_style → field JSONHighlighter.base_style: ClassVar[str] - changed:
field JSONHighlighter.highlights → field JSONHighlighter.highlights: ClassVar[Sequence[str]] - changed:
field RegexHighlighter.base_style: str → field RegexHighlighter.base_style: ClassVar[str] - changed:
field RegexHighlighter.highlights: List[str] → field RegexHighlighter.highlights: ClassVar[Sequence[str]] - changed:
field ReprHighlighter.highlights → field ReprHighlighter.highlights: ClassVar[Sequence[str]]
- added:
property LiveRender.last_render_height -> int
- changed:
constructor RichHandler(level: Union[int, str]=…, console: Optional[Console]=…, *, show_time: bool=…, omit_repeated_times: bool=…, show_level: bool=…, show_path: bool=…, enable_link_path: bool=…, highlighter: Optional[Highlighter]=…, markup: bool=…, rich_tracebacks: bool=…, tracebacks_width: Optional[int]=…, tracebacks_code_width: int=…, tracebacks_extra_lines: int=…, tracebacks_theme: Optional[s… → constructor RichHandler(level: Union[int, str]=…, console: Optional[Console]=…, *, show_time: bool=…, omit_repeated_times: bool=…, show_level: bool=…, show_path: bool=…, enable_link_path: bool=…, highlighter: Optional[Highlighter]=…, markup: bool=…, rich_tracebacks: bool=…, tracebacks_width: Optional[int]=…, tracebacks_code_width: Optional[int]=…, tracebacks_extra_lines: int=…, tracebacks_theme:…
- added:
class HeadingFormat - added:
field Heading.LEVEL_ALIGN: ClassVar[dict[str, JustifyMethod]] - added:
field HeadingFormat.justify: JustifyMethod - added:
field HeadingFormat.style: str
- changed:
function track(sequence: Union[Sequence[ProgressType], Iterable[ProgressType]], description: str=…, total: Optional[float]=…, completed: int=…, auto_refresh: bool=…, console: Optional[Console]=…, transient: bool=…, get_time: Optional[Callable[[], float]]=…, refresh_per_second: float=…, style: StyleType=…, complete_style: StyleType=…, finished_style: StyleType=…, pulse_style: StyleType=…, update_p… → function track(sequence: Iterable[ProgressType], description: str=…, total: Optional[float]=…, completed: int=…, auto_refresh: bool=…, console: Optional[Console]=…, transient: bool=…, get_time: Optional[Callable[[], float]]=…, refresh_per_second: float=…, style: StyleType=…, complete_style: StyleType=…, finished_style: StyleType=…, pulse_style: StyleType=…, update_period: float=…, disable: bool=…… - changed:
method Progress.track(sequence: Union[Iterable[ProgressType], Sequence[ProgressType]], total: Optional[float]=…, completed: int=…, task_id: Optional[TaskID]=…, description: str=…, update_period: float=…) -> Iterable[ProgressType] → method Progress.track(sequence: Iterable[ProgressType], total: Optional[float]=…, completed: int=…, task_id: Optional[TaskID]=…, description: str=…, update_period: float=…) -> Iterable[ProgressType]
- changed:
function render_scope(scope: Mapping[str, Any], *, title: Optional[TextType]=…, sort_keys: bool=…, indent_guides: bool=…, max_length: Optional[int]=…, max_string: Optional[int]=…) -> ConsoleRenderable → function render_scope(scope: Mapping[str, Any], *, title: Optional[TextType]=…, sort_keys: bool=…, indent_guides: bool=…, max_length: Optional[int]=…, max_string: Optional[int]=…, max_depth: Optional[int]=…, overflow: Optional[OverflowMethod]=…) -> ConsoleRenderable
- removed:
variable log - added:
static method Segment.split_lines_terminator(segments: Iterable[Segment]) -> Iterable[Tuple[List[Segment], bool]]
- added:
class PaddingProperty - added:
field Syntax.padding
- changed:
constructor Traceback(trace: Optional[Trace]=…, *, width: Optional[int]=…, code_width: Optional[int]=…, extra_lines: int=…, theme: Optional[str]=…, word_wrap: bool=…, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_hide_dunder: bool=…, locals_hide_sunder: bool=…, indent_guides: bool=…, suppress: Iterable[Union[str, ModuleType]]=…, max_frames: int=…) → constructor Traceback(trace: Optional[Trace]=…, *, width: Optional[int]=…, code_width: Optional[int]=…, extra_lines: int=…, theme: Optional[str]=…, word_wrap: bool=…, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_max_depth: Optional[int]=…, locals_hide_dunder: bool=…, locals_hide_sunder: bool=…, locals_overlow: Optional[OverflowMethod]=…, indent_guides: bool=…, s… - changed:
function install(*, console: Optional[Console]=…, width: Optional[int]=…, code_width: Optional[int]=…, extra_lines: int=…, theme: Optional[str]=…, word_wrap: bool=…, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_hide_dunder: bool=…, locals_hide_sunder: Optional[bool]=…, indent_guides: bool=…, suppress: Iterable[Union[str, ModuleType]]=…, max_frames: int=…) -> Cal… → function install(*, console: Optional[Console]=…, width: Optional[int]=…, code_width: Optional[int]=…, extra_lines: int=…, theme: Optional[str]=…, word_wrap: bool=…, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_max_depth: Optional[int]=…, locals_hide_dunder: bool=…, locals_hide_sunder: Optional[bool]=…, locals_overflow: Optional[OverflowMethod]=…, indent_guides:… - changed:
static method Traceback.extract(exc_type: Type[BaseException], exc_value: BaseException, traceback: Optional[TracebackType], *, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_hide_dunder: bool=…, locals_hide_sunder: bool=…) -> Trace → static method Traceback.extract(exc_type: Type[BaseException], exc_value: BaseException, traceback: Optional[TracebackType], *, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_max_depth: Optional[int]=…, locals_hide_dunder: bool=…, locals_hide_sunder: bool=…, _visited_exceptions: Optional[Set[BaseException]]=…) -> Trace - changed:
static method Traceback.from_exception(exc_type: Type[Any], exc_value: BaseException, traceback: Optional[TracebackType], *, width: Optional[int]=…, code_width: Optional[int]=…, extra_lines: int=…, theme: Optional[str]=…, word_wrap: bool=…, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_hide_dunder: bool=…, locals_hide_sunder: bool=…, indent_guides: bool=…, suppre… → static method Traceback.from_exception(exc_type: Type[Any], exc_value: BaseException, traceback: Optional[TracebackType], *, width: Optional[int]=…, code_width: Optional[int]=…, extra_lines: int=…, theme: Optional[str]=…, word_wrap: bool=…, show_locals: bool=…, locals_max_length: int=…, locals_max_string: int=…, locals_max_depth: Optional[int]=…, locals_hide_dunder: bool=…, locals_hide_sunder: bo… - added:
field Stack.exceptions: List[Trace] - added:
field Stack.is_group: bool - added:
field Stack.notes: List[str]