diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 155fb61bc..b44496ba5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,7 +2,7 @@ The following people have contributed to the development of Rich: - + - [Patrick Arminio](https://github.com/patrick91) - [Gregory Beauregard](https://github.com/GBeauregard/pyffstream) @@ -21,6 +21,7 @@ The following people have contributed to the development of Rich: - [Lanqing Huang](https://github.com/lqhuang) - [Finn Hughes](https://github.com/finnhughes) - [Josh Karpel](https://github.com/JoshKarpel) +- [Hugo van Kemenade](https://github.com/hugovk) - [Andrew Kettmann](https://github.com/akettmann) - [Martin Larralde](https://github.com/althonos) - [Hedy Li](https://github.com/hedythedev) @@ -55,4 +56,4 @@ The following people have contributed to the development of Rich: - [Motahhar Mokfi](https://github.com/motahhar) - [Tomer Shalev](https://github.com/tomers) - [Serkan UYSAL](https://github.com/uysalserkan) -- [Zhe Huang](https://github.com/onlyacat) \ No newline at end of file +- [Zhe Huang](https://github.com/onlyacat) diff --git a/rich/pretty.py b/rich/pretty.py index 3e83b200b..ee0491c0d 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -642,7 +642,6 @@ def _traverse(obj: Any, root: bool = False, depth: int = 0) -> Node: return Node(value_repr="...") obj_type = type(obj) - py_version = (sys.version_info.major, sys.version_info.minor) children: List[Node] reached_max_depth = max_depth is not None and depth >= max_depth @@ -780,7 +779,7 @@ def iter_attrs() -> Iterable[ is_dataclass(obj) and not _safe_isinstance(obj, type) and not fake_attributes - and (_is_dataclass_repr(obj) or py_version == (3, 6)) + and _is_dataclass_repr(obj) ): push_visited(obj_id) children = [] diff --git a/tests/test_inspect.py b/tests/test_inspect.py index 79737c018..f2befbb99 100644 --- a/tests/test_inspect.py +++ b/tests/test_inspect.py @@ -13,11 +13,6 @@ ) from rich.console import Console -skip_py36 = pytest.mark.skipif( - sys.version_info.minor == 6 and sys.version_info.major == 3, - reason="rendered differently on py3.6", -) - skip_py37 = pytest.mark.skipif( sys.version_info.minor == 7 and sys.version_info.major == 3, reason="rendered differently on py3.7", @@ -89,7 +84,6 @@ class FooSubclass(Foo): pass -@skip_py36 def test_render(): console = Console(width=100, file=io.StringIO(), legacy_windows=False) @@ -118,7 +112,6 @@ def test_inspect_text(): assert render("Hello") == expected -@skip_py36 @skip_py37 @skip_pypy3 def test_inspect_empty_dict(): @@ -194,7 +187,6 @@ async def coroutine(): assert render(coroutine).startswith(expected) -@skip_py36 def test_inspect_integer(): expected = ( "╭────── ───────╮\n" @@ -210,7 +202,6 @@ def test_inspect_integer(): assert expected == render(1) -@skip_py36 def test_inspect_integer_with_value(): expected = "╭────── ───────╮\n│ int([x]) -> integer │\n│ int(x, base=10) -> integer │\n│ │\n│ ╭────────────────────────╮ │\n│ │ 1 │ │\n│ ╰────────────────────────╯ │\n│ │\n│ denominator = 1 │\n│ imag = 0 │\n│ numerator = 1 │\n│ real = 1 │\n╰────────────────────────────╯\n" value = render(1, value=True) @@ -218,7 +209,6 @@ def test_inspect_integer_with_value(): assert value == expected -@skip_py36 @skip_py37 @skip_py310 @skip_py311 @@ -255,7 +245,6 @@ def test_inspect_integer_with_methods_python38_and_python39(): assert render(1, methods=True) == expected -@skip_py36 @skip_py37 @skip_py38 @skip_py39 @@ -297,7 +286,6 @@ def test_inspect_integer_with_methods_python310only(): assert render(1, methods=True) == expected -@skip_py36 @skip_py37 @skip_py38 @skip_py39 @@ -341,7 +329,6 @@ def test_inspect_integer_with_methods_python311_and_above(): assert render(1, methods=True) == expected -@skip_py36 @skip_py37 @skip_pypy3 def test_broken_call_attr(): diff --git a/tests/test_pretty.py b/tests/test_pretty.py index 2b24d9073..53256379b 100644 --- a/tests/test_pretty.py +++ b/tests/test_pretty.py @@ -4,7 +4,7 @@ from array import array from collections import UserDict, defaultdict from dataclasses import dataclass, field -from typing import List, NamedTuple, Any +from typing import Any, List, NamedTuple from unittest.mock import patch import attr @@ -15,11 +15,6 @@ from rich.pretty import Node, Pretty, _ipy_display_hook, install, pprint, pretty_repr from rich.text import Text -skip_py36 = pytest.mark.skipif( - sys.version_info.minor == 6 and sys.version_info.major == 3, - reason="rendered differently on py3.6", -) - skip_py37 = pytest.mark.skipif( sys.version_info.minor == 7 and sys.version_info.major == 3, reason="rendered differently on py3.7", @@ -289,7 +284,6 @@ def __repr__(self): assert result == "Hello World!\n" -@skip_py36 def test_broken_repr(): class BrokenRepr: def __repr__(self): @@ -301,7 +295,6 @@ def __repr__(self): assert result == expected -@skip_py36 def test_broken_getattr(): class BrokenAttr: def __getattr__(self, name): @@ -618,7 +611,6 @@ class Nada: assert result == expected -@skip_py36 @skip_py310 @skip_py311 def test_attrs_broken(): @@ -634,7 +626,6 @@ class Foo: assert result == expected -@skip_py36 @skip_py37 @skip_py38 @skip_py39 diff --git a/tests/test_repr.py b/tests/test_repr.py index 3c2f48a46..faabb90f0 100644 --- a/tests/test_repr.py +++ b/tests/test_repr.py @@ -1,15 +1,10 @@ -import pytest import sys from typing import Optional -from rich.console import Console -import rich.repr - +import pytest -skip_py36 = pytest.mark.skipif( - sys.version_info.minor == 6 and sys.version_info.major == 3, - reason="rendered differently on py3.6", -) +import rich.repr +from rich.console import Console skip_py37 = pytest.mark.skipif( sys.version_info.minor == 7 and sys.version_info.major == 3, @@ -71,7 +66,6 @@ def test_rich_repr() -> None: assert (repr(Foo("hello", bar=3))) == "Foo('hello', 'hello', bar=3, egg=1)" -@skip_py36 @skip_py37 def test_rich_repr_positional_only() -> None: _locals = locals().copy() diff --git a/tox.ini b/tox.ini index b1e21f3b7..25cfbfa27 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ minversion = 3.9.0 envlist = lint docs - py{36,37,38,39} + py{37,38,39,310} isolated_build = True [testenv]