From 98a3397ecd3456a02e60ab2d3aeceda59bce3658 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 12 Mar 2024 17:37:29 -0300 Subject: [PATCH] Replace reorder-python-imports by isort Due to https://github.com/psf/black/issues/4175 --- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 4 ++++ src/pytest_rich/plugin.py | 1 + src/pytest_rich/traceback.py | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c0b7881..e92d435 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,11 +30,11 @@ repos: ] language: python files: \.py$ - - repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 + - repo: https://github.com/pycqa/isort + rev: 5.13.2 hooks: - - id: reorder-python-imports - args: ["--application-directories=.:src"] + - id: isort + name: isort - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.9.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 5fc4909..ab6c843 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,10 @@ build-backend = "setuptools.build_meta" [tool.setuptools_scm] +[tool.isort] +profile = "black" +force_single_line = "true" + [tool.pytest.ini_options] addopts = "--ignore tests/example" pytester_example_dir = "tests/example" diff --git a/src/pytest_rich/plugin.py b/src/pytest_rich/plugin.py index ab7345b..f7dc8fd 100644 --- a/src/pytest_rich/plugin.py +++ b/src/pytest_rich/plugin.py @@ -1,6 +1,7 @@ """ Proof of concept for pytest + rich integration. """ + import sys import pytest diff --git a/src/pytest_rich/traceback.py b/src/pytest_rich/traceback.py index 192bd10..6aaa822 100644 --- a/src/pytest_rich/traceback.py +++ b/src/pytest_rich/traceback.py @@ -21,8 +21,8 @@ from rich.console import Console from rich.console import ConsoleOptions from rich.console import ConsoleRenderable -from rich.console import group from rich.console import RenderResult +from rich.console import group from rich.highlighter import ReprHighlighter from rich.panel import Panel from rich.rule import Rule