Skip to content

Commit

Permalink
Merge branch 'master' into tuple-rich-repr-positional
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Sep 19, 2022
2 parents 4ae2be6 + eaba862 commit f0cbc46
Show file tree
Hide file tree
Showing 139 changed files with 2,193 additions and 460 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Expand Up @@ -7,4 +7,4 @@ jobs:
- uses: actions/checkout@v3
- run: python3 -m pip install codespell
- run: codespell --ignore-words-list="ba,fo,hel,revered,womens"
--skip="./README.*.md,*.svg,./benchmarks/snippets.py"
--skip="./README.*.md,*.svg,./benchmarks/snippets.py,./tests,./tools"
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Expand Up @@ -35,7 +35,7 @@ jobs:
run: |
source $VENV
make typecheck
- name: Test with pytest
- name: Test with pytest (with coverage)
run: |
source $VENV
pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/update_benchmark_website.yml

This file was deleted.

1 change: 1 addition & 0 deletions .pre-commit-config.yaml
@@ -1,5 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: benchmarks/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
Expand Down
53 changes: 43 additions & 10 deletions CHANGELOG.md
Expand Up @@ -5,16 +5,47 @@ 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).

## [12.4.5] - Unreleased

## [Unreleased]

### Added

- Parse ANSI escape sequences in pretty repr https://github.com/Textualize/rich/pull/2470
- Add support for `FORCE_COLOR` env var https://github.com/Textualize/rich/pull/2449
- Allow a `max_depth` argument to be passed to the `install()` hook https://github.com/Textualize/rich/issues/2486
- Document using `None` as name in `__rich_repr__` for tuple posotional args https://github.com/Textualize/rich/pull/2379

### Fixed

- Handle stdout/stderr being null https://github.com/Textualize/rich/pull/2513
- Fix NO_COLOR support on legacy Windows https://github.com/Textualize/rich/pull/2458

## [12.5.2] - 2022-07-18

### Added

- Add Turkish Readme.

## [12.5.1] - 2022-07-11

### Fixed

- Fixed missing typing extensions dependency on 3.9 https://github.com/Textualize/rich/issues/2386

## [12.5.0] - 2022-07-11

### Added

- Environment variables `JUPYTER_COLUMNS` and `JUPYTER_LINES` to control width and height of console in Jupyter
- Markdown friendly `Box` style, `MARKDOWN`, for rendering tables ready to copy into markdown files
- `inspect` will prefix coroutine functions with `async def`
- `Style.__add__` will no longer return `NotImplemented`
- Remove rich.\_lru_cache

### Changed

- Default width of Jupyter console size is increased to 115
- Optimized Segment.divide

### Fixed

Expand All @@ -25,12 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix edges used in first row of tables when `show_header=False` https://github.com/Textualize/rich/pull/2330
- Fix interaction between `Capture` contexts and `Console(record=True)` https://github.com/Textualize/rich/pull/2343
- Fixed hash issue in Styles class https://github.com/Textualize/rich/pull/2346
- Document using `None` as name in `__rich_repr__` for tuple posotional args https://github.com/Textualize/rich/pull/2379

### Changed

- `Style.__add__` will no longer return `NotImplemented`
- Remove rich.\_lru_cache
- Fixed bug in `Segment.split_and_crop_lines`

## [12.4.4] - 2022-05-24

Expand Down Expand Up @@ -1796,9 +1822,13 @@ Major version bump for a breaking change to `Text.stylize signature`, which corr

- First official release, API still to be stabilized

[unreleased]: https://github.com/willmcgugan/rich/compare/v12.4.3...HEAD
[12.4.1]: https://github.com/willmcgugan/rich/compare/v12.4.2...v12.4.3
[12.4.1]: https://github.com/willmcgugan/rich/compare/v12.4.1...v12.4.2
[unreleased]: https://github.com/willmcgugan/rich/compare/v12.5.2...HEAD
[12.5.2]: https://github.com/willmcgugan/rich/compare/v12.5.1...v12.5.2
[12.5.1]: https://github.com/willmcgugan/rich/compare/v12.5.0...v12.5.1
[12.5.0]: https://github.com/willmcgugan/rich/compare/v12.4.4...v12.5.0
[12.4.4]: https://github.com/willmcgugan/rich/compare/v12.4.3...v12.4.4
[12.4.3]: https://github.com/willmcgugan/rich/compare/v12.4.2...v12.4.3
[12.4.2]: https://github.com/willmcgugan/rich/compare/v12.4.1...v12.4.2
[12.4.1]: https://github.com/willmcgugan/rich/compare/v12.4.0...v12.4.1
[12.4.0]: https://github.com/willmcgugan/rich/compare/v12.3.0...v12.4.0
[12.3.0]: https://github.com/willmcgugan/rich/compare/v12.2.0...v12.3.0
Expand Down Expand Up @@ -1944,3 +1974,6 @@ Major version bump for a breaking change to `Text.stylize signature`, which corr
[0.4.1]: https://github.com/willmcgugan/rich/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/willmcgugan/rich/compare/v0.3.3...v0.4.0
[0.3.3]: https://github.com/willmcgugan/rich/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/willmcgugan/rich/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/willmcgugan/rich/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/willmcgugan/rich/compare/v0.2.0...v0.3.0
100 changes: 95 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -6,22 +6,54 @@ For new features or if there is any doubt in how to fix a bug, you might want
to open an issue prior to starting work, or email willmcgugan+rich@gmail.com
to discuss it first.

## Development Environment
## Prerequisites

Rich uses [poetry](https://python-poetry.org/docs/) for packaging and
dependency management. To start developing with Rich, install Poetry
using the [recommended method](https://python-poetry.org/docs/#installation) or run:
using the [recommended method](https://python-poetry.org/docs/#installation).

Next, you'll need to create a _fork_ (your own personal copy) of the Rich repository, and clone that fork
on to your local machine. GitHub offers a great tutorial for this process [here](https://docs.github.com/en/get-started/quickstart/fork-a-repo).
After following this guide, you'll have a local copy of the Rich project installed.

Enter the directory containing your copy of Rich (`cd rich`).

Poetry can be used to create an isolated _virtual environment_ for the project:

```
pip install poetry
poetry shell
```

Once Poetry is installed, install the dependencies with the following command:
The first time we run `poetry shell`, such an isolated environment is created and forever associated with our project.
Any time we wish to enter this virtual environment again, we simply run `poetry shell` again.

Now we can install the dependencies of Rich into the virtual environment:

```
poetry install
```

The rest of this guide assumes you're inside the virtual environment.
If you're having difficulty running any of the commands that follow,
ensure you're inside the virtual environment by running `poetry shell`.

## Developing

At this point, you're ready to start developing.
Some things to consider while developing Rich code include:

* Ensure new code is documented in docstrings
* Avoid abbreviations in variable or class names
* Aim for consistency in coding style and API design

Before each [commit](https://github.com/git-guides/git-commit), you should:

1. Run the tests and ensure they pass
2. Ensure type-checking passes
3. Format the code using `black`

These steps are described in the following sections.

### Tests

Run tests with the following command:
Expand All @@ -38,6 +70,10 @@ pytest --cov-report term-missing --cov=rich tests/ -vv

New code should ideally have tests and not break existing tests.

The "Coverage Report" that gets printed to the terminal after the tests run can be used
to identify lines of code that haven't been covered by tests.
If any of the new lines you've added or modified appear in this report, you should strongly consider adding tests which exercise them.

### Type Checking

Rich uses type annotations throughout, and `mypy` to do the checking.
Expand All @@ -53,7 +89,7 @@ Or if you don't have `make`:
mypy -p rich --config-file= --ignore-missing-imports --no-implicit-optional --warn-unreachable
```

Please add type annotations for all new code.
Please add type annotations for all new code, and ensure that type checking succeeds before creating a pull request.

### Code Formatting

Expand All @@ -62,3 +98,57 @@ I recommend setting up black in your editor to format on save.

To run black from the command line, use `make format-check` to check your formatting,
and use `make format` to format and write to the files.

### Consider Documentation

Consider whether the change you made would benefit from documentation - if the feature has any user impact at all, the answer is almost certainly yes!
Documentation can be found in the `docs` directory.
There are some additional dependencies required to build the documentation.
These dependencies can be installed by running (from the `docs` directory):

```
pip install -r requirements.txt
```

After updating the documentation, you can build them (from the project root directory) by running:

```
make docs
```

This will generate the static HTML for the documentation site at `docs/build/html`.

### Update CHANGELOG and CONTRIBUTORS

Before submitting your pull request, update the `CHANGELOG.md` file describing, briefly, what you've done.
Be sure to follow the format seen in the rest of the document.

If this is your first time contributing to Rich:

1. Welcome!
2. Be sure to add your name to `CONTRIBUTORS.md`.

### Pre-Commit

We strongly recommend you [install the pre-commit hooks](https://pre-commit.com/#installation) included in the repository.
These automatically run some of the checks described earlier each time you run `git commit`,
and over time can reduce development overhead quite considerably.

## Creating A Pull Request

Once your happy with your change and have ensured that all steps above have been followed (and checks have passed), you can create a pull request.
GitHub offers a guide on how to do this [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
Please ensure that you include a good description of what your change does in your pull request, and link it to any relevant issues or discussions.

When you create your pull request, we'll run the checks described earlier. If they fail, please attempt to fix them as we're unlikely to be able to review your code until then.
If you've exhausted all options on trying to fix a failing check, feel free to leave a note saying so in the pull request and someone may be able to offer assistance.

### Code Review

After the checks in your pull request pass, someone will review your code.
There may be some discussion and, in most cases, a few iterations will be required to find a solution that works best.

## Afterwards

When the pull request is approved, it will be merged into the `master` branch.
Your change will only be available to users the next time Rich is released.
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Expand Up @@ -27,22 +27,27 @@ The following people have contributed to the development of Rich:
- [Will McGugan](https://github.com/willmcgugan)
- [Paul McGuire](https://github.com/ptmcg)
- [Antony Milne](https://github.com/AntonyMilneQB)
- [Michael Milton](https://github.com/multimeric)
- [Nathan Page](https://github.com/nathanrpage97)
- [Avi Perl](https://github.com/avi-perl)
- [Laurent Peuch](https://github.com/psycojoker)
- [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)
- [Clément Robert](https://github.com/neutrinoceros)
- [Brian Rutledge](https://github.com/bhrutledge)
- [Tushar Sadhwani](https://github.com/tusharsadhwani)
- [Paul Sanders](https://github.com/sanders41)
- [Tim Savage](https://github.com/timsavage)
- [Anthony Shaw](https://github.com/tonybaloney)
- [Nicolas Simonds](https://github.com/0xDEC0DE)
- [Aaron Stephens](https://github.com/aaronst)
- [Gabriele N. Tornetta](https://github.com/p403n1x87)
- [Arian Mollik Wasi](https://github.com/wasi-master)
- [Handhika Yanuar Pratama](https://github.com/theDreamer911)
- [za](https://github.com/za)
- [Motahhar Mokfi](https://github.com/motahhar)
- [Tomer Shalev](https://github.com/tomers)
- [Serkan UYSAL](https://github.com/uysalserkan)
2 changes: 2 additions & 0 deletions Makefile
@@ -1,5 +1,7 @@
test:
TERM=unknown pytest --cov-report term-missing --cov=rich tests/ -vv
test-no-cov:
TERM=unknown pytest tests/ -vv
format-check:
black --check .
format:
Expand Down
1 change: 1 addition & 0 deletions README.cn.md
Expand Up @@ -21,6 +21,7 @@
[Italian readme](https://github.com/willmcgugan/rich/blob/master/README.it.md)
[Русский readme](https://github.com/willmcgugan/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/willmcgugan/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/willmcgugan/rich/blob/master/README.tr.md)

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

Expand Down
1 change: 1 addition & 0 deletions README.de-ch.md
Expand Up @@ -21,6 +21,7 @@
[Italian readme](https://github.com/willmcgugan/rich/blob/master/README.it.md)
[Русский readme](https://github.com/willmcgugan/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/willmcgugan/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/willmcgugan/rich/blob/master/README.tr.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 @@ -21,6 +21,7 @@
[Italian readme](https://github.com/willmcgugan/rich/blob/master/README.it.md)
[Русский readme](https://github.com/willmcgugan/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/willmcgugan/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/willmcgugan/rich/blob/master/README.tr.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 @@ -21,6 +21,7 @@
[Italian readme](https://github.com/willmcgugan/rich/blob/master/README.it.md)
[Русский readme](https://github.com/willmcgugan/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/willmcgugan/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/willmcgugan/rich/blob/master/README.tr.md)

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

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

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

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

Rich est une bibliothèque Python pour le _rich_ texte et la mise en forme dans le terminal.

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

Rich टर्मिनल में _समृद्ध_ पाठ और सुंदर स्वरूपण के लिए एक Python संग्रह है।

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

Rich adalah library Python yang membantu _memperindah_ tampilan output suatu program di terminal.

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


Rich è una libreria Python per un testo _rich_ e con una piacevole formattazione nel terminale.
Expand Down
1 change: 1 addition & 0 deletions README.ja.md
Expand Up @@ -21,6 +21,7 @@
[Italian readme](https://github.com/willmcgugan/rich/blob/master/README.it.md)
[Русский readme](https://github.com/willmcgugan/rich/blob/master/README.ru.md)
[فارسی readme](https://github.com/willmcgugan/rich/blob/master/README.fa.md)
[Türkçe readme](https://github.com/willmcgugan/rich/blob/master/README.tr.md)

Richは、 _リッチ_ なテキストや美しい書式設定をターミナルで行うためのPythonライブラリです。

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

Rich는 터미널에서 _풍부한(rich)_ 텍스트와 아름다운 서식을 지원하기 위한 파이썬 라이브러리입니다.

Expand Down

0 comments on commit f0cbc46

Please sign in to comment.