Upgrading rich 3 to 4
Breaking3.4.1 → 4.2.2Breaking2New3Changed3Fixed8
BreakingUpgrade verdict
2 breaking changes.
In plain terms
- The stylize_all method is gone; use stylize with just a style to style all the text.
- The stylize method now takes the style as its first argument, and if you leave out the start and end positions it styles the whole text.
Must act 2 items need code or config changes
What you must change
Breaking2
Removes Text.stylize_all, which is no longer necessary now that Text.stylize styles the whole text by default.
Text.stylize_allText.stylizeChanges Text.stylize signature to accept style first, with start and end offsets defaulting to the entire text.
Text.stylizeAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- changed:
constructor RichHandler(level: int=…, console: Console=…, *, show_path: bool=…, enable_link_path: bool=…, highlighter: Highlighter=…) -> None → constructor RichHandler(level: int=…, console: Console=…, *, show_time: bool=…, show_level: bool=…, show_path: bool=…, enable_link_path: bool=…, highlighter: Highlighter=…, markup: bool=…) -> None
- changed:
function track(sequence: Union[Sequence[ProgressType], Iterable[ProgressType]], description=…, total: int=…, auto_refresh=…, console: Optional[Console]=…, transient: bool=…, get_time: Callable[[], float]=…, refresh_per_second: int=…, style: StyleType=…, complete_style: StyleType=…, finished_style: StyleType=…, pulse_style: StyleType=…) -> Iterable[ProgressType] → function track(sequence: Union[Sequence[ProgressType], Iterable[ProgressType]], description=…, total: int=…, auto_refresh=…, console: Optional[Console]=…, transient: bool=…, get_time: Callable[[], float]=…, refresh_per_second: int=…, style: StyleType=…, complete_style: StyleType=…, finished_style: StyleType=…, pulse_style: StyleType=…, update_period: float=…) -> Iterable[ProgressType] - changed:
method Progress.track(sequence: Union[Iterable[ProgressType], Sequence[ProgressType]], total: int=…, task_id: Optional[TaskID]=…, description=…) -> Iterable[ProgressType] → method Progress.track(sequence: Union[Iterable[ProgressType], Sequence[ProgressType]], total: int=…, task_id: Optional[TaskID]=…, description=…, update_period: float=…) -> Iterable[ProgressType]
- added:
method Confirm.render_default(default: DefaultType) -> Text - added:
method PromptBase.render_default(default: DefaultType) -> Text
- removed:
method Text.stylize_all(style: Union[str, Style]) -> None - changed:
method Text.split(separator=…, *, include_separator: bool=…) -> Lines → method Text.split(separator=…, *, include_separator: bool=…, allow_blank: bool=…) -> Lines - changed:
method Text.stylize(start: int, end: int, style: Union[str, Style]) -> None → method Text.stylize(style: Union[str, Style], start: int=…, end: Optional[int]=…) -> None