Skip to content

Commit

Permalink
Merge branch 'master' into fix-spinner-style-type
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Mar 4, 2023
2 parents 5444d80 + 3588894 commit 81bb9ab
Show file tree
Hide file tree
Showing 79 changed files with 1,720 additions and 1,326 deletions.
20 changes: 20 additions & 0 deletions .faq/FAQ.md
@@ -0,0 +1,20 @@

# Frequently Asked Questions

{%- for question in questions %}
- [{{ question.title }}](#{{ question.slug }})
{%- endfor %}


{%- for question in questions %}

<a name="{{ question.slug }}"></a>
## {{ question.title }}

{{ question.body }}

{%- endfor %}

<hr>

Generated by [FAQtory](https://github.com/willmcgugan/faqtory)
20 changes: 20 additions & 0 deletions .faq/suggest.md
@@ -0,0 +1,20 @@
{%- if questions -%}
{% if questions|length == 1 %}
We found the following entry in the [FAQ]({{ faq_url }}) which you may find helpful:
{%- else %}
We found the following entries in the [FAQ]({{ faq_url }}) which you may find helpful:
{%- endif %}

{% for question in questions %}
- [{{ question.title }}]({{ faq_url }}#{{ question.slug }})
{%- endfor %}

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

{%- else -%}
Thank you for your issue. Give us a little time to review it.

PS. You might want to check the [FAQ]({{ faq_url }}) if you haven't done so already.
{%- endif %}

This is an automated reply, generated by [FAQtory](https://github.com/willmcgugan/faqtory)
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -6,7 +6,8 @@ labels: Needs triage
assignees: ""
---

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).
- [ ] 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.
- [ ] I can't find my issue in the [FAQ](https://github.com/Textualize/rich/blob/master/FAQ.md).

**Describe the bug**

Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Expand Up @@ -9,3 +9,7 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
7 changes: 4 additions & 3 deletions .github/workflows/comment.yml
Expand Up @@ -13,6 +13,7 @@ jobs:
with:
issue-number: ${{ github.event.issue.number }}
body: |
Did I solve your problem?
Why not buy the devs a [coffee](https://ko-fi.com/textualize) to say thanks?
I hope we solved your problem.
If you like using Rich, you might also enjoy [Textual](https://textual.textualize.io)
27 changes: 27 additions & 0 deletions .github/workflows/newissue.yml
@@ -0,0 +1,27 @@
name: issues
on:
issues:
types: [opened]
jobs:
add-comment:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Install FAQtory
run: pip install FAQtory
- name: Run Suggest
run: faqtory suggest "${{ github.event.issue.title }}" > suggest.md
- name: Read suggest.md
id: suggest
uses: juliangruber/read-file-action@v1
with:
path: ./suggest.md
- name: Suggest FAQ
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
with:
issue-number: ${{ github.event.issue.number }}
body: ${{ steps.suggest.outputs.content }}
12 changes: 6 additions & 6 deletions .github/workflows/pythonpackage.yml
Expand Up @@ -8,22 +8,22 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install and configure Poetry
# TODO: workaround for https://github.com/snok/install-poetry/issues/94
uses: snok/install-poetry@v1.3.1
uses: snok/install-poetry@v1.3.3
with:
version: 1.1.11
version: 1.3.1
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install
Expand All @@ -41,7 +41,7 @@ jobs:
source $VENV
pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing
- name: Upload code coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand Down
90 changes: 88 additions & 2 deletions CHANGELOG.md
Expand Up @@ -5,7 +5,81 @@ 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).

## [13.0.0] - Unreleased

## [13.3.2] - Unreleased

### Fixed

- Reversed `pre` and `code` tags in base HTML format https://github.com/Textualize/rich/pull/2642
- Fix syntax error when building with nuitka https://github.com/Textualize/rich/pull/2635
- Fixed pretty printing of empty dataclass https://github.com/Textualize/rich/issues/2819
- Use `Console(stderr=True)` in `rich.traceback.install` to support io redirection.
- Fixes superfluous spaces in html output https://github.com/Textualize/rich/issues/2832
- Fixed duplicate output in Jupyter https://github.com/Textualize/rich/pulls/2804
- Filter ANSI character-encoding-change codes in `Text.from_ansi` parser
- Fixes traceback failing when a frame filename is unreadable https://github.com/Textualize/rich/issues/2821

### Added

- Added Polish README

### Changed

- `rich.progress.track()` will now show the elapsed time after finishing the task https://github.com/Textualize/rich/pull/2659

## [13.3.1] - 2023-01-28

### Fixed

- Fixed truecolor to eight bit color conversion https://github.com/Textualize/rich/pull/2785

## [13.3.0] - 2023-01-27

### Fixed

- Fixed failing tests due to Pygments dependency https://github.com/Textualize/rich/issues/2757
- Relaxed ipywidgets https://github.com/Textualize/rich/issues/2767

### Added

- Added `encoding` parameter in `Theme.read`


## [13.2.0] - 2023-01-19

### Changed

- Switch Markdown parsing from commonmark to markdown-it-py https://github.com/Textualize/rich/pull/2439

## [13.1.0] - 2023-01-14

### Fixed

- Fixed wrong filenames in Jupyter tracebacks https://github.com/Textualize/rich/issues/2271

### Added

- 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

### Changed

- Tracebacks will now hide double underscore names from locals by default. Set `locals_hide_dunder=False` to restore previous behaviour.

## [13.0.1] - 2023-01-06

### Fixed

- Fixed issue with Segment.split_cells for mixed single and double cell widths

## [13.0.0] - 2022-12-30

### Fixed

- Reversed `pre` and `code` tags in base HTML format https://github.com/Textualize/rich/pull/2642
- Improved detection of `attrs` library, that isn't confused by the presence of the `attr` library.
- Fixed issue with `locals_max_length` parameter not being respected in Traceback https://github.com/Textualize/rich/issues/2649
- Handling of broken `fileno` made more robust. Fixes https://github.com/Textualize/rich/issues/2645
- Fixed missing `fileno` on FileProxy

### Fixed

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

- Bumped minimum Python version to 3.7 https://github.com/Textualize/rich/pull/2567
- Pretty-printing of "tagged" `__repr__` results is now greedy when matching tags https://github.com/Textualize/rich/pull/2565
- `progress.track` now supports deriving total from `__length_hint__`

### Added

- Add type annotation for key_separator of pretty.Node https://github.com/Textualize/rich/issues/2625


## [12.6.0] - 2022-10-02

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

- First official release, API still to be stabilized

[12.6.0]: https://github.com/textualize/rich/compare/v12.5.2...HEAD
[13.3.1]: https://github.com/textualize/rich/compare/v13.3.0...v13.3.1
[13.3.0]: https://github.com/textualize/rich/compare/v13.2.0...v13.3.0
[13.2.0]: https://github.com/textualize/rich/compare/v13.1.0...v13.2.0
[13.1.0]: https://github.com/textualize/rich/compare/v13.0.1...v13.1.0
[13.0.1]: https://github.com/textualize/rich/compare/v13.0.0...v13.0.1
[13.0.0]: https://github.com/textualize/rich/compare/v12.6.0...v13.0.0
[12.6.0]: https://github.com/textualize/rich/compare/v12.5.2...v12.6.0
[12.5.2]: https://github.com/textualize/rich/compare/v12.5.1...v12.5.2
[12.5.1]: https://github.com/textualize/rich/compare/v12.5.0...v12.5.1
[12.5.0]: https://github.com/textualize/rich/compare/v12.4.4...v12.5.0
Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTORS.md
Expand Up @@ -6,6 +6,7 @@ The following people have contributed to the development of Rich:

- [Patrick Arminio](https://github.com/patrick91)
- [Gregory Beauregard](https://github.com/GBeauregard/pyffstream)
- [Artur Borecki](https://github.com/pufereq)
- [Dennis Brakhane](https://github.com/brakhane)
- [Darren Burns](https://github.com/darrenburns)
- [Jim Crist-Harif](https://github.com/jcrist)
Expand All @@ -17,10 +18,13 @@ The following people have contributed to the development of Rich:
- [Michał Górny](https://github.com/mgorny)
- [Nok Lam Chan](https://github.com/noklam)
- [Leron Gray](https://github.com/daddycocoaman)
- [Andre Hora](https://github.com/andrehora)
- [Kenneth Hoste](https://github.com/boegel)
- [Lanqing Huang](https://github.com/lqhuang)
- [Finn Hughes](https://github.com/finnhughes)
- [Ionite](https://github.com/ionite34)
- [Josh Karpel](https://github.com/JoshKarpel)
- [Jan Katins](https://github.com/jankatins)
- [Hugo van Kemenade](https://github.com/hugovk)
- [Andrew Kettmann](https://github.com/akettmann)
- [Martin Larralde](https://github.com/althonos)
Expand All @@ -33,13 +37,16 @@ The following people have contributed to the development of Rich:
- [Michael Milton](https://github.com/multimeric)
- [Martina Oefelein](https://github.com/oefe)
- [Nathan Page](https://github.com/nathanrpage97)
- [Dave Pearson](https://github.com/davep/)
- [Avi Perl](https://github.com/avi-perl)
- [Laurent Peuch](https://github.com/psycojoker)
- [Ronny Pfannschmidt](https://github.com/RonnyPfannschmidt/)
- [Olivier Philippon](https://github.com/DrBenton)
- [Kylian Point](https://github.com/p0lux)
- [Kyle Pollina](https://github.com/kylepollina)
- [Sebastián Ramírez](https://github.com/tiangolo)
- [Felipe Guedes](https://github.com/guedesfelipe)
- [Min RK](https://github.com/minrk)
- [Clément Robert](https://github.com/neutrinoceros)
- [Brian Rutledge](https://github.com/bhrutledge)
- [Tushar Sadhwani](https://github.com/tusharsadhwani)
Expand All @@ -58,3 +65,7 @@ The following people have contributed to the development of Rich:
- [Serkan UYSAL](https://github.com/uysalserkan)
- [Zhe Huang](https://github.com/onlyacat)
- [Adrian Zuber](https://github.com/xadrianzetx)
- [Ke Sun](https://github.com/ksun212)
- [Qiming Xu](https://github.com/xqm32)
- [James Addison](https://github.com/jayaddison)

55 changes: 55 additions & 0 deletions FAQ.md
@@ -0,0 +1,55 @@

# Frequently Asked Questions
- [Why does emoji break alignment in a Table or Panel?](#why-does-emoji-break-alignment-in-a-table-or-panel)
- [Why does content in square brackets disappear?](#why-does-content-in-square-brackets-disappear)
- [python -m rich.spinner shows extra lines](#python--m-rich.spinner-shows-extra-lines)
- [How do I log a renderable?](#how-do-i-log-a-renderable)
- [Strange colors in console output.](#strange-colors-in-console-output.)

<a name="why-does-emoji-break-alignment-in-a-table-or-panel"></a>
## Why does emoji break alignment in a Table or Panel?

Certain emoji take up double space within the terminal. Unfortunately, terminals don't always agree how wide a given character should be.

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.

There are also *multiple codepoints* characters, such as country flags, and emoji modifiers, which produce wildly different results across terminal emulators.

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,

<a name="why-does-content-in-square-brackets-disappear"></a>
## Why does content in square brackets disappear?

Rich will treat text within square brackets as *markup tags*, for instance `"[bold]This is bold[/bold]"`.

If you are printing strings with literally square brackets you can either disable markup, or escape your strings.
See the docs on [console markup](https://rich.readthedocs.io/en/latest/markup.html) for how to do this.

<a name="python--m-rich.spinner-shows-extra-lines"></a>
## python -m rich.spinner shows extra lines

The spinner example is know to break on some terminals (Windows in particular).

Some terminals don't display emoji with the correct width, which means Rich can't always align them accurately inside a panel.

<a name="how-do-i-log-a-renderable"></a>
## How do I log a renderable?

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.

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.

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.

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.

<a name="strange-colors-in-console-output."></a>
## Strange colors in console output.

Rich will highlight certain patterns in your output such as numbers, strings, and other objects like IP addresses.

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.

<hr>

Generated by [FAQtory](https://github.com/willmcgugan/faqtory)
1 change: 1 addition & 0 deletions README.cn.md
Expand Up @@ -22,6 +22,7 @@
[Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md)
[Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md)

Rich 是一个 Python 库,可以为您在终端中提供富文本和精美格式。

Expand Down
1 change: 1 addition & 0 deletions README.de-ch.md
Expand Up @@ -22,6 +22,7 @@
[Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md)
[Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md)

Rich isch ä Python Library för _rich_ Text ond ganz schöni formatiärig im Törminäl

Expand Down
1 change: 1 addition & 0 deletions README.de.md
Expand Up @@ -22,6 +22,7 @@
[Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md)
[Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md)

Rich ist eine Python-Bibliothek für _rich_ Text und schöne Formatierung im Terminal.

Expand Down
1 change: 1 addition & 0 deletions README.es.md
Expand Up @@ -22,6 +22,7 @@
[Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md)
[Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md)

Rich es un paquete de Python para texto _enriquecido_ y un hermoso formato en la terminal.

Expand Down
3 changes: 2 additions & 1 deletion README.fa.md
@@ -1,4 +1,4 @@
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/rich/10.11.0)](https://pypi.org/project/rich/) [![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/rich/13.2.0)](https://pypi.org/project/rich/) [![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich)

[![Downloads](https://pepy.tech/badge/rich/month)](https://pepy.tech/project/rich)
[![codecov](https://img.shields.io/codecov/c/github/Textualize/rich?label=codecov&logo=codecov)](https://codecov.io/gh/textualize/rich)
Expand All @@ -23,6 +23,7 @@
[Русский readme](https://github.com/textualize/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/textualize/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/textualize/rich/blob/master/README.tr.md)
[Polskie readme](https://github.com/textualize/rich/blob/master/README.pl.md)

ریچ یک کتاب خانه پایتون برای متن های _باشکوه_ و قالب بندی زیبا در ترمینال است.

Expand Down

0 comments on commit 81bb9ab

Please sign in to comment.