Skip to content

Commit 81bb9ab

Browse files
authored
Merge branch 'master' into fix-spinner-style-type
2 parents 5444d80 + 3588894 commit 81bb9ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1720
-1326
lines changed

.faq/FAQ.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
# Frequently Asked Questions
3+
4+
{%- for question in questions %}
5+
- [{{ question.title }}](#{{ question.slug }})
6+
{%- endfor %}
7+
8+
9+
{%- for question in questions %}
10+
11+
<a name="{{ question.slug }}"></a>
12+
## {{ question.title }}
13+
14+
{{ question.body }}
15+
16+
{%- endfor %}
17+
18+
<hr>
19+
20+
Generated by [FAQtory](https://github.com/willmcgugan/faqtory)

.faq/suggest.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{%- if questions -%}
2+
{% if questions|length == 1 %}
3+
We found the following entry in the [FAQ]({{ faq_url }}) which you may find helpful:
4+
{%- else %}
5+
We found the following entries in the [FAQ]({{ faq_url }}) which you may find helpful:
6+
{%- endif %}
7+
8+
{% for question in questions %}
9+
- [{{ question.title }}]({{ faq_url }}#{{ question.slug }})
10+
{%- endfor %}
11+
12+
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.
13+
14+
{%- else -%}
15+
Thank you for your issue. Give us a little time to review it.
16+
17+
PS. You might want to check the [FAQ]({{ faq_url }}) if you haven't done so already.
18+
{%- endif %}
19+
20+
This is an automated reply, generated by [FAQtory](https://github.com/willmcgugan/faqtory)

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ labels: Needs triage
66
assignees: ""
77
---
88

9-
You may find a solution to your problem in the [docs](https://rich.readthedocs.io/en/latest/introduction.html) or [issues](https://github.com/textualize/rich/issues).
9+
- [ ] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions.
10+
- [ ] I can't find my issue in the [FAQ](https://github.com/Textualize/rich/blob/master/FAQ.md).
1011

1112
**Describe the bug**
1213

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "daily"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "daily"

.github/workflows/comment.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
with:
1414
issue-number: ${{ github.event.issue.number }}
1515
body: |
16-
Did I solve your problem?
17-
18-
Why not buy the devs a [coffee](https://ko-fi.com/textualize) to say thanks?
16+
I hope we solved your problem.
17+
18+
If you like using Rich, you might also enjoy [Textual](https://textual.textualize.io)
19+

.github/workflows/newissue.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: issues
2+
on:
3+
issues:
4+
types: [opened]
5+
jobs:
6+
add-comment:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
issues: write
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
ref: master
14+
- name: Install FAQtory
15+
run: pip install FAQtory
16+
- name: Run Suggest
17+
run: faqtory suggest "${{ github.event.issue.title }}" > suggest.md
18+
- name: Read suggest.md
19+
id: suggest
20+
uses: juliangruber/read-file-action@v1
21+
with:
22+
path: ./suggest.md
23+
- name: Suggest FAQ
24+
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
25+
with:
26+
issue-number: ${{ github.event.issue.number }}
27+
body: ${{ steps.suggest.outputs.content }}

.github/workflows/pythonpackage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ jobs:
88
strategy:
99
matrix:
1010
os: [windows-latest, ubuntu-latest, macos-latest]
11-
python-version: ["3.7", "3.8", "3.9", "3.10"]
11+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0"]
1212
defaults:
1313
run:
1414
shell: bash
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
architecture: x64
2222
- name: Install and configure Poetry
2323
# TODO: workaround for https://github.com/snok/install-poetry/issues/94
24-
uses: snok/[email protected].1
24+
uses: snok/[email protected].3
2525
with:
26-
version: 1.1.11
26+
version: 1.3.1
2727
virtualenvs-in-project: true
2828
- name: Install dependencies
2929
run: poetry install
@@ -41,7 +41,7 @@ jobs:
4141
source $VENV
4242
pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing
4343
- name: Upload code coverage
44-
uses: codecov/codecov-action@v2
44+
uses: codecov/codecov-action@v3
4545
with:
4646
token: ${{ secrets.CODECOV_TOKEN }}
4747
file: ./coverage.xml

CHANGELOG.md

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,81 @@ 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-
## [13.0.0] - Unreleased
8+
9+
## [13.3.2] - Unreleased
10+
11+
### Fixed
12+
13+
- Reversed `pre` and `code` tags in base HTML format https://github.com/Textualize/rich/pull/2642
14+
- Fix syntax error when building with nuitka https://github.com/Textualize/rich/pull/2635
15+
- Fixed pretty printing of empty dataclass https://github.com/Textualize/rich/issues/2819
16+
- Use `Console(stderr=True)` in `rich.traceback.install` to support io redirection.
17+
- Fixes superfluous spaces in html output https://github.com/Textualize/rich/issues/2832
18+
- Fixed duplicate output in Jupyter https://github.com/Textualize/rich/pulls/2804
19+
- Filter ANSI character-encoding-change codes in `Text.from_ansi` parser
20+
- Fixes traceback failing when a frame filename is unreadable https://github.com/Textualize/rich/issues/2821
21+
22+
### Added
23+
24+
- Added Polish README
25+
26+
### Changed
27+
28+
- `rich.progress.track()` will now show the elapsed time after finishing the task https://github.com/Textualize/rich/pull/2659
29+
30+
## [13.3.1] - 2023-01-28
31+
32+
### Fixed
33+
34+
- Fixed truecolor to eight bit color conversion https://github.com/Textualize/rich/pull/2785
35+
36+
## [13.3.0] - 2023-01-27
37+
38+
### Fixed
39+
40+
- Fixed failing tests due to Pygments dependency https://github.com/Textualize/rich/issues/2757
41+
- Relaxed ipywidgets https://github.com/Textualize/rich/issues/2767
42+
43+
### Added
44+
45+
- Added `encoding` parameter in `Theme.read`
46+
47+
48+
## [13.2.0] - 2023-01-19
49+
50+
### Changed
51+
52+
- Switch Markdown parsing from commonmark to markdown-it-py https://github.com/Textualize/rich/pull/2439
53+
54+
## [13.1.0] - 2023-01-14
55+
56+
### Fixed
57+
58+
- Fixed wrong filenames in Jupyter tracebacks https://github.com/Textualize/rich/issues/2271
59+
60+
### Added
61+
62+
- Added locals_hide_dunder and locals_hide_sunder to Tracebacks, to hide double underscore and single underscore locals. https://github.com/Textualize/rich/pull/2754
63+
64+
### Changed
65+
66+
- Tracebacks will now hide double underscore names from locals by default. Set `locals_hide_dunder=False` to restore previous behaviour.
67+
68+
## [13.0.1] - 2023-01-06
69+
70+
### Fixed
71+
72+
- Fixed issue with Segment.split_cells for mixed single and double cell widths
73+
74+
## [13.0.0] - 2022-12-30
75+
76+
### Fixed
77+
78+
- Reversed `pre` and `code` tags in base HTML format https://github.com/Textualize/rich/pull/2642
79+
- Improved detection of `attrs` library, that isn't confused by the presence of the `attr` library.
80+
- Fixed issue with `locals_max_length` parameter not being respected in Traceback https://github.com/Textualize/rich/issues/2649
81+
- Handling of broken `fileno` made more robust. Fixes https://github.com/Textualize/rich/issues/2645
82+
- Fixed missing `fileno` on FileProxy
983

1084
### Fixed
1185

@@ -15,6 +89,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1589

1690
- Bumped minimum Python version to 3.7 https://github.com/Textualize/rich/pull/2567
1791
- Pretty-printing of "tagged" `__repr__` results is now greedy when matching tags https://github.com/Textualize/rich/pull/2565
92+
- `progress.track` now supports deriving total from `__length_hint__`
93+
94+
### Added
95+
96+
- Add type annotation for key_separator of pretty.Node https://github.com/Textualize/rich/issues/2625
97+
1898

1999
## [12.6.0] - 2022-10-02
20100

@@ -1844,7 +1924,13 @@ Major version bump for a breaking change to `Text.stylize signature`, which corr
18441924

18451925
- First official release, API still to be stabilized
18461926

1847-
[12.6.0]: https://github.com/textualize/rich/compare/v12.5.2...HEAD
1927+
[13.3.1]: https://github.com/textualize/rich/compare/v13.3.0...v13.3.1
1928+
[13.3.0]: https://github.com/textualize/rich/compare/v13.2.0...v13.3.0
1929+
[13.2.0]: https://github.com/textualize/rich/compare/v13.1.0...v13.2.0
1930+
[13.1.0]: https://github.com/textualize/rich/compare/v13.0.1...v13.1.0
1931+
[13.0.1]: https://github.com/textualize/rich/compare/v13.0.0...v13.0.1
1932+
[13.0.0]: https://github.com/textualize/rich/compare/v12.6.0...v13.0.0
1933+
[12.6.0]: https://github.com/textualize/rich/compare/v12.5.2...v12.6.0
18481934
[12.5.2]: https://github.com/textualize/rich/compare/v12.5.1...v12.5.2
18491935
[12.5.1]: https://github.com/textualize/rich/compare/v12.5.0...v12.5.1
18501936
[12.5.0]: https://github.com/textualize/rich/compare/v12.4.4...v12.5.0

CONTRIBUTORS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The following people have contributed to the development of Rich:
66

77
- [Patrick Arminio](https://github.com/patrick91)
88
- [Gregory Beauregard](https://github.com/GBeauregard/pyffstream)
9+
- [Artur Borecki](https://github.com/pufereq)
910
- [Dennis Brakhane](https://github.com/brakhane)
1011
- [Darren Burns](https://github.com/darrenburns)
1112
- [Jim Crist-Harif](https://github.com/jcrist)
@@ -17,10 +18,13 @@ The following people have contributed to the development of Rich:
1718
- [Michał Górny](https://github.com/mgorny)
1819
- [Nok Lam Chan](https://github.com/noklam)
1920
- [Leron Gray](https://github.com/daddycocoaman)
21+
- [Andre Hora](https://github.com/andrehora)
2022
- [Kenneth Hoste](https://github.com/boegel)
2123
- [Lanqing Huang](https://github.com/lqhuang)
2224
- [Finn Hughes](https://github.com/finnhughes)
25+
- [Ionite](https://github.com/ionite34)
2326
- [Josh Karpel](https://github.com/JoshKarpel)
27+
- [Jan Katins](https://github.com/jankatins)
2428
- [Hugo van Kemenade](https://github.com/hugovk)
2529
- [Andrew Kettmann](https://github.com/akettmann)
2630
- [Martin Larralde](https://github.com/althonos)
@@ -33,13 +37,16 @@ The following people have contributed to the development of Rich:
3337
- [Michael Milton](https://github.com/multimeric)
3438
- [Martina Oefelein](https://github.com/oefe)
3539
- [Nathan Page](https://github.com/nathanrpage97)
40+
- [Dave Pearson](https://github.com/davep/)
3641
- [Avi Perl](https://github.com/avi-perl)
3742
- [Laurent Peuch](https://github.com/psycojoker)
43+
- [Ronny Pfannschmidt](https://github.com/RonnyPfannschmidt/)
3844
- [Olivier Philippon](https://github.com/DrBenton)
3945
- [Kylian Point](https://github.com/p0lux)
4046
- [Kyle Pollina](https://github.com/kylepollina)
4147
- [Sebastián Ramírez](https://github.com/tiangolo)
4248
- [Felipe Guedes](https://github.com/guedesfelipe)
49+
- [Min RK](https://github.com/minrk)
4350
- [Clément Robert](https://github.com/neutrinoceros)
4451
- [Brian Rutledge](https://github.com/bhrutledge)
4552
- [Tushar Sadhwani](https://github.com/tusharsadhwani)
@@ -58,3 +65,7 @@ The following people have contributed to the development of Rich:
5865
- [Serkan UYSAL](https://github.com/uysalserkan)
5966
- [Zhe Huang](https://github.com/onlyacat)
6067
- [Adrian Zuber](https://github.com/xadrianzetx)
68+
- [Ke Sun](https://github.com/ksun212)
69+
- [Qiming Xu](https://github.com/xqm32)
70+
- [James Addison](https://github.com/jayaddison)
71+

FAQ.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
# Frequently Asked Questions
3+
- [Why does emoji break alignment in a Table or Panel?](#why-does-emoji-break-alignment-in-a-table-or-panel)
4+
- [Why does content in square brackets disappear?](#why-does-content-in-square-brackets-disappear)
5+
- [python -m rich.spinner shows extra lines](#python--m-rich.spinner-shows-extra-lines)
6+
- [How do I log a renderable?](#how-do-i-log-a-renderable)
7+
- [Strange colors in console output.](#strange-colors-in-console-output.)
8+
9+
<a name="why-does-emoji-break-alignment-in-a-table-or-panel"></a>
10+
## Why does emoji break alignment in a Table or Panel?
11+
12+
Certain emoji take up double space within the terminal. Unfortunately, terminals don't always agree how wide a given character should be.
13+
14+
Rich has no way of knowing how wide a character will be on any given terminal. This can break alignment in containers like Table and Panel, where Rich needs to know the width of the content.
15+
16+
There are also *multiple codepoints* characters, such as country flags, and emoji modifiers, which produce wildly different results across terminal emulators.
17+
18+
Fortunately, most characters will work just fine. But you may have to avoid using the emojis that break alignment. You will get good results if you stick to emoji released on or before version 9 of the Unicode database,
19+
20+
<a name="why-does-content-in-square-brackets-disappear"></a>
21+
## Why does content in square brackets disappear?
22+
23+
Rich will treat text within square brackets as *markup tags*, for instance `"[bold]This is bold[/bold]"`.
24+
25+
If you are printing strings with literally square brackets you can either disable markup, or escape your strings.
26+
See the docs on [console markup](https://rich.readthedocs.io/en/latest/markup.html) for how to do this.
27+
28+
<a name="python--m-rich.spinner-shows-extra-lines"></a>
29+
## python -m rich.spinner shows extra lines
30+
31+
The spinner example is know to break on some terminals (Windows in particular).
32+
33+
Some terminals don't display emoji with the correct width, which means Rich can't always align them accurately inside a panel.
34+
35+
<a name="how-do-i-log-a-renderable"></a>
36+
## How do I log a renderable?
37+
38+
Python's logging module is designed to work with strings. Consequently you won't be able to log Rich renderables (Table, Tree, etc) by calling `logger.debug` or other similar method.
39+
40+
You could use the [capture](https://rich.readthedocs.io/en/latest/console.html#capturing-output) API to convert the renderable to a string and log that. However I would advise against it.
41+
42+
Logging supports configurable back-ends, which means that a log message could go somewhere other than the terminal -- which may not correctly render the formatting and style produced by Rich.
43+
44+
If you are only logging with a file-handler to stdout, then you probably don't need to use the logging module at all. Consider using [Console.log](https://rich.readthedocs.io/en/latest/reference/console.html#rich.console.Console.log) which will render anything that you can print with Rich, with a timestamp.
45+
46+
<a name="strange-colors-in-console-output."></a>
47+
## Strange colors in console output.
48+
49+
Rich will highlight certain patterns in your output such as numbers, strings, and other objects like IP addresses.
50+
51+
Occasionally this may also highlight parts of your output you didn't intend. See the [docs on highlighting](https://rich.readthedocs.io/en/latest/highlighting.html) for how to disable highlighting.
52+
53+
<hr>
54+
55+
Generated by [FAQtory](https://github.com/willmcgugan/faqtory)

0 commit comments

Comments
 (0)