Compare commits

2 Commits
1.1 ... main

5 changed files with 254 additions and 34 deletions

44
pygments.patch Normal file
View File

@@ -0,0 +1,44 @@
From 08be21dadfd2ce9e96e41e366ab38bd8d7cd0e39 Mon Sep 17 00:00:00 2001
From: Dan Lazin <dlazin@users.noreply.github.com>
Date: Tue, 7 Jan 2025 16:04:56 -0500
Subject: [PATCH] Fix test that changed with Pygments 2.19.
---
tests/test_markdown.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: rich-13.9.4/tests/test_markdown.py
===================================================================
--- rich-13.9.4.orig/tests/test_markdown.py
+++ rich-13.9.4/tests/test_markdown.py
@@ -110,7 +110,7 @@ def test_inline_code():
inline_code_theme="emacs",
)
result = render(markdown)
- expected = "inline \x1b[1;38;2;170;34;255;48;2;248;248;248mimport\x1b[0m\x1b[38;2;0;0;0;48;2;248;248;248m \x1b[0m\x1b[1;38;2;0;0;255;48;2;248;248;248mthis\x1b[0m code \n"
+ expected = "inline \x1b[1;38;2;170;34;255;48;2;248;248;248mimport\x1b[0m\x1b[38;2;187;187;187;48;2;248;248;248m \x1b[0m\x1b[1;38;2;0;0;255;48;2;248;248;248mthis\x1b[0m code \n"
print(result)
print(repr(result))
assert result == expected
Index: rich-13.9.4/tests/test_syntax.py
===================================================================
--- rich-13.9.4.orig/tests/test_syntax.py
+++ rich-13.9.4/tests/test_syntax.py
@@ -53,7 +53,7 @@ def test_blank_lines():
print(repr(result))
assert (
result
- == "\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m1 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m2 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m3 \x1b[0m\x1b[1;38;2;0;128;0;48;2;248;248;248mimport\x1b[0m\x1b[38;2;0;0;0;48;2;248;248;248m \x1b[0m\x1b[1;38;2;0;0;255;48;2;248;248;248mthis\x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m4 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m5 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n"
+ == "\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m1 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m2 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m3 \x1b[0m\x1b[1;38;2;0;128;0;48;2;248;248;248mimport\x1b[0m\x1b[38;2;187;187;187;48;2;248;248;248m \x1b[0m\x1b[1;38;2;0;0;255;48;2;248;248;248mthis\x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m4 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n\x1b[1;38;2;24;24;24;48;2;248;248;248m \x1b[0m\x1b[38;2;173;173;173;48;2;248;248;248m5 \x1b[0m\x1b[48;2;248;248;248m \x1b[0m\n"
)
@@ -119,7 +119,7 @@ def test_python_render_simple_indent_gui
)
rendered_syntax = render(syntax)
print(repr(rendered_syntax))
- expected = '\x1b[34mdef\x1b[0m \x1b[32mloop_first_last\x1b[0m(values: Iterable[T]) -> Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2;37m│ \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│ \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n\x1b[2m│ \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│ │ \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│ \x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│ │ \x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│ \x1b[0mfirst = \x1b[34mTrue\x1b[0m\n\x1b[2m│ \x1b[0m\x1b[34mfor\x1b[0m value \x1b[35min\x1b[0m iter_values:\n\x1b[2m│ │ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│ │ \x1b[0mfirst = \x1b[34mFalse\x1b[0m\n\x1b[2m│ │ \x1b[0mprevious_value = value\n\x1b[2m│ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
+ expected = '\x1b[34mdef\x1b[0m\x1b[37m \x1b[0m\x1b[32mloop_first_last\x1b[0m(values: Iterable[T]) -> Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2;37m│ \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│ \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n\x1b[2m│ \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│ │ \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│ \x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│ │ \x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│ \x1b[0mfirst = \x1b[34mTrue\x1b[0m\n\x1b[2m│ \x1b[0m\x1b[34mfor\x1b[0m value \x1b[35min\x1b[0m iter_values:\n\x1b[2m│ │ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│ │ \x1b[0mfirst = \x1b[34mFalse\x1b[0m\n\x1b[2m│ │ \x1b[0mprevious_value = value\n\x1b[2m│ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
assert rendered_syntax == expected

View File

@@ -1,3 +1,181 @@
-------------------------------------------------------------------
Fri May 30 13:35:48 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
- Update to 14.0.0
* Added
- Added env var TTY_COMPATIBLE to override auto-detection of TTY
support (See console.rst for details). #3675
* Changed
- An empty NO_COLOR env var is now considered disabled. #3675
- An empty FORCE_COLOR env var is now considered disabled. #3675
- Rich tracebacks will now render notes on Python 3.11 onwards
(added with Exception.add_note) #3676
- Indentation in exceptions won't be underlined #3678
- Rich tracebacks will now render Exception Groups #3677
-------------------------------------------------------------------
Tue Apr 22 14:51:30 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add test dependency on attrs
-------------------------------------------------------------------
Fri Jan 17 14:55:32 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add pygments.patch to fix tests with Pygments 2.19
-------------------------------------------------------------------
Thu Dec 5 01:45:25 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to GitHub tarball so we can run the testsuite.
- Correct version guard for typing_extensions Requires.
- Drop Python 3.7 sections.
-------------------------------------------------------------------
Wed Nov 20 17:44:21 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 13.9.4:
* Optimizations to cell_len which may speed up Rich / Textual
output https://github.com/Textualize/rich/pull/3546
- update to 13.9.3:
* Fix a broken regex that resulted in the slow path being
chosen for some operations. This fix should result in notable
speedups for some operations, such as wrapping text.
* Fixed broken regex that may have resulted in poor
performance. https://github.com/Textualize/rich/pull/3535
- update to 13.9.2:
* A hotfix for highlighting in the table, and a fix for
`Segment.split_cells`
* Fixed `Table` columns not highlighting when added by
`add_row` https://github.com/Textualize/rich/issues/3517
* Fixed an issue with Segment.split_cells reported in Textual
https://github.com/Textualize/textual/issues/5090
- update to 13.9.1:
* Fixed typing_extensions dependency
- update to 13.9.0:
* Dropped support for Python3.7
* Rich will display tracebacks with finely grained error
locations on python 3.11+
* Fixed issue with Segment._split_cells
* Fix auto detection of terminal size on Windows
* `Text.style` now respected in Panel title/subtitle
- update to 13.8.1:
* Added support for Python 3.13
* Fixed infinite loop when appending Text to same instance
- update to 13.8.0:
* Fixed `Table` rendering of box elements so "footer" elements
truly appear at bottom of table, "mid" elements in main table
body.
* Fixed styles in Panel when Text objects are used for title
* Fix pretty repr for `collections.deque`
* Thread used in progress.track will exit if an exception
occurs in a generator
* Progress track thread is now a daemon thread
* Fixed cached hash preservation upon clearing meta and links
* Fixed overriding the `background_color` of `Syntax` not
including padding
* Fixed pretty printing of dataclasses with a default repr in
Python 3.13
* Fixed selective enabling of highlighting when disabled in the
`Console`
* Fixed BrokenPipeError writing an error message
* Fixed superfluous space above Markdown tables
* Fixed issue with record and capture interaction
* Fixed control codes breaking in `append_tokens`
* Fixed exception pretty printing a dataclass with missing
* `RichHandler` errors and warnings will now use different
colors (red and yellow)
* Removed the empty line printed in jupyter while using
`Progress`
* Running tests in environment with `FORCE_COLOR` or `NO_COLOR`
environment variables
* ansi decoder will now strip problematic private escape
sequences
* Tree's ASCII_GUIDES and TREE_GUIDES constants promoted to
class attributes
* Adds a `case_sensitive` parameter to `prompt.Prompt`. This
determines if the response is treated as case-sensitive.
* Added `Console.on_broken_pipe`
-------------------------------------------------------------------
Sat Mar 16 09:47:51 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 13.7.1:
* Fixes some character widths
-------------------------------------------------------------------
Thu Nov 16 21:27:11 UTC 2023 - Benoît Monin <benoit.monin@gmx.fr>
- update to version 13.7.0:
* Added
+ Adds missing parameters to Panel.fit #3142
+ Fixed
+ Some text goes missing during wrapping when it contains
double width characters #3176
+ Ensure font is correctly inherited in exported HTML #3104
+ Fixed typing for FloatPrompt.
- additional changes from 13.6.0:
* Added Python 3.12 to classifiers.
- additional changes from 13.5.3:
* Fixed
+ Markdown table rendering issue with inline styles and links
#3115
+ Fix Markdown code blocks on a light background #3123
-------------------------------------------------------------------
Sun Aug 27 21:36:07 UTC 2023 - Arun Persaud <arun@gmx.de>
- specfile:
* update copyright year
- update to version 13.5.2:
* Fixed
+ Fixed Text.expand_tab assertion error
- changes from version 13.5.1:
* Fixed
+ Fix tilde character (~) not included in link regex when printing
to console #3057
- changes from version 13.5.0:
* Fixed
+ Fixed Text.expand_tabs not expanding spans.
+ Fixed TimeElapsedColumn from showing negative.
+ Fix for escaping strings with a trailing backslash #2987
+ Fixed exception in Markdown with partial table #3053
+ Fixed the HTML export template so that the <html> tag comes
before the <head> tag #3021
+ Fixed issue with custom classes overwriting __eq__ #2875
+ Fix rich.pretty.install breakage in iPython #3013
* Added
+ Added Text.extend_style method.
+ Added Span.extend method.
* Changed
+ Text.tab_size now defaults to None to indicate that
Console.tab_size should be used.
-------------------------------------------------------------------
Wed Jul 19 09:18:31 UTC 2023 - ecsos <ecsos@opensuse.org>
- %{?sle15_python_module_pythons} mut be at beginning to work.
-------------------------------------------------------------------
Sat Jul 8 20:32:32 UTC 2023 - Arun Persaud <arun@gmx.de>
- specfile:
* update copyright year
- update to version 13.4.2:
* Changed
+ Relaxed markdown-it-py dependency
-------------------------------------------------------------------
Thu Jun 1 06:05:31 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- update to 13.4.1:
* Fixed typing extensions import in markdown #2979
- update to 13.4.0:
* Added support for tables in Markdown #2977
-------------------------------------------------------------------
Thu May 4 21:06:58 UTC 2023 - Dirk Müller <dmueller@suse.com>
@@ -212,7 +390,7 @@ Thu Jul 7 10:34:00 UTC 2022 - Dirk Müller <dmueller@suse.com>
-------------------------------------------------------------------
Thu Apr 14 07:17:44 UTC 2022 - Hui-Zhi Zhao <hui.zhi.zhao@suse.com>
- Ignore python3.6.2 for test since it doesn't support it.
- Ignore python3.6.2 for test since it doesn't support it.
-------------------------------------------------------------------
Fri Jan 14 20:08:47 UTC 2022 - Ben Greiner <code@bnavigator.de>
@@ -474,7 +652,7 @@ Mon Jan 25 10:30:46 UTC 2021 - Ben Greiner <code@bnavigator.de>
* Fixed Tracebacks ignoring initial blank lines
* Partial fix for tracebacks not finding source after chdir
Added
* Added post_style argument to Segment.apply_style
* Added post_style argument to Segment.apply_style
- Changelog for 9.8.2
* Fixed deadlock in live #927
- Changelog for 9.8.1
@@ -486,14 +664,14 @@ Mon Jan 25 10:30:46 UTC 2021 - Ben Greiner <code@bnavigator.de>
* Added rich.align.VerticalCenter
Changed
* The style argument on Align now applies to background only
* Changed display of progress bars in no_color mode for
* Changed display of progress bars in no_color mode for
clarity
* Console property size will fall back to getting the
terminal size of stdout it stdin fails, this allows size
* Console property size will fall back to getting the
terminal size of stdout it stdin fails, this allows size
to be correctly determined when piping
Fixed
* Fixed panel cropping when shrunk too bar
* Allow passing markdown over STDIN when using python -m
* Allow passing markdown over STDIN when using python -m
rich.markdown
* Fix printing MagicMock.mock_calls #903
- Changelog for 9.7.0
@@ -501,18 +679,18 @@ Mon Jan 25 10:30:46 UTC 2021 - Ben Greiner <code@bnavigator.de>
* Added no_color argument to Console
- Changelog for 9.6.2
* Fixed markup escaping edge case #878
* Double tag escape, i.e. "\\[foo]" results in a
* Double tag escape, i.e. "\\[foo]" results in a
backslash plus [foo] tag
* Fixed header_style not applying to headers in
* Fixed header_style not applying to headers in
positional args #953
- Changelog for 9.6.1
* Fixed encoding error on Windows when loading code for
* Fixed encoding error on Windows when loading code for
Tracebacks
- Changelog for 9.6.0
Changed
* MarkupError exception raise from None to omit internal
* MarkupError exception raise from None to omit internal
exception
* Factored out RichHandler.render and
* Factored out RichHandler.render and
RichHandler.render_message for easier extending
* Display pretty printed value in rich.inspect
Added
@@ -601,7 +779,7 @@ Fri Dec 18 19:46:52 UTC 2020 - Martin Hauke <mardnh@gmx.de>
-------------------------------------------------------------------
Tue Oct 27 00:12:00 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Kill dephell dependency
- Kill dephell dependency
-------------------------------------------------------------------
Sun Oct 25 15:36:02 UTC 2020 - Martin Hauke <mardnh@gmx.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-rich
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2020-2021, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
@@ -17,37 +17,32 @@
#
%define skip_python2 1
%{?sle15_python_module_pythons}
Name: python-rich
Version: 13.3.5
Version: 14.0.0
Release: 0
Summary: A Python library for rich text and beautiful formatting in the terminal
License: MIT
Group: Development/Languages/Python
URL: https://github.com/Textualize/rich
Source: https://files.pythonhosted.org/packages/source/r/rich/rich-%{version}.tar.gz
BuildRequires: %{python_module dataclasses >= 0.7 if %python-base < 3.7}
Source: https://github.com/Textualize/rich/archive/refs/tags/v%{version}.tar.gz#/rich-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/Textualize/rich/pull/3604 Fix test that changed with Pygments 2.19.
# and https://github.com/Textualize/rich/pull/3608 fix remaining tests with Pygments 2.19 #3604 did not fix
Patch: pygments.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module markdown-it-py >= 2.2.0}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module poetry-core}
BuildRequires: %{python_module pygments >= 2.13.0}
BuildRequires: %{python_module typing_extensions >= 4.0.0 if %python-base < 3.9}
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module pytest}
# /SECTION
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-markdown-it-py >= 2.2.0
Requires: python-pygments >= 2.13.0
Suggests: python-ipywidgets >= 7.5.1
%if 0%{?python_version_nodots} < 39
Requires: python-typing_extensions >= 4.0.0
%endif
%if 0%{?python_version_nodots} < 37
Requires: python-dataclasses >= 0.7
%endif
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module attrs}
# /SECTION
%python_subpackages
%description
@@ -55,7 +50,7 @@ Render rich text, tables, progress bars, syntax highlighting,
markdown and more to the terminal.
%prep
%setup -q -n rich-%{version}
%autosetup -p1 -n rich-%{version}
%build
%pyproject_wheel
@@ -64,10 +59,13 @@ markdown and more to the terminal.
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/rich
%{python_sitelib}/rich-%{version}*-info
%{python_sitelib}/rich-%{version}.dist-info
%changelog

BIN
rich-13.3.5.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
rich-14.0.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.