Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,31 +132,40 @@ messages_control.disable = [

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"NPY", # NumPy specific rules
"PD", # pandas-vet
"PERF", # perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"T20", # flake8-print
"TC", # flake8-type-checking
"UP", # pyupgrade
"YTT", # flake8-2020
]
ignore = [
"E501",
"E722",
"RUF001", # Unicode chars
"PLR",
"ISC001", # Conflicts with formatter
]
unfixable = [
"SIM118", # Dict .keys() removal (uproot)
Expand Down
2 changes: 0 additions & 2 deletions src/uproot_browser/_version.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
from __future__ import annotations

version: str
version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]
6 changes: 4 additions & 2 deletions src/uproot_browser/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import dataclasses
import functools
from collections.abc import Iterable
from pathlib import Path
from typing import Any, Literal, Protocol, TypedDict
from typing import TYPE_CHECKING, Any, Literal, Protocol, TypedDict

import uproot
import uproot.reading
Expand All @@ -17,6 +16,9 @@
from rich.text import Text
from rich.tree import Tree

if TYPE_CHECKING:
from collections.abc import Iterable

console = Console()

__all__ = (
Expand Down
6 changes: 4 additions & 2 deletions src/uproot_browser/tui/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__package__ = "uproot_browser.tui" # pylint: disable=redefined-builtin

import contextlib
from typing import Any, ClassVar
from typing import TYPE_CHECKING, Any, ClassVar

import plotext as plt
import rich.syntax
Expand Down Expand Up @@ -37,11 +37,13 @@
from .header import Header
from .help import HelpScreen
from .left_panel import UprootTree
from .messages import ErrorMessage, RequestPlot, UprootSelected
from .plot import Plotext
from .tools import Info, Tools
from .viewer import ViewWidget

if TYPE_CHECKING:
from .messages import ErrorMessage, RequestPlot, UprootSelected


class Browser(textual.app.App[object]):
"""A basic implementation of the uproot-browser TUI"""
Expand Down
5 changes: 4 additions & 1 deletion src/uproot_browser/tui/error.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from __future__ import annotations

import dataclasses
from types import TracebackType
from typing import TYPE_CHECKING

import rich.console
import rich.traceback

if TYPE_CHECKING:
from types import TracebackType


@dataclasses.dataclass
class Error:
Expand Down
6 changes: 4 additions & 2 deletions src/uproot_browser/tui/left_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from pathlib import Path
from typing import Any, ClassVar
from typing import TYPE_CHECKING, Any, ClassVar

import rich.panel
import rich.text
Expand All @@ -10,11 +10,13 @@
import textual.widgets
import textual.widgets.tree
import uproot
from rich.style import Style

from ..tree import UprootEntry
from .messages import UprootSelected

if TYPE_CHECKING:
from rich.style import Style


class UprootTree(textual.widgets.Tree[UprootEntry]):
"""currently just extending DirectoryTree, showing current path"""
Expand Down
3 changes: 2 additions & 1 deletion src/uproot_browser/tui/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import dataclasses
import sys
from collections.abc import Iterable
from typing import TYPE_CHECKING, Any

import plotext as plt # plots in text
Expand All @@ -15,6 +14,8 @@
from .messages import EmptyMessage, ErrorMessage, RequestPlot

if TYPE_CHECKING:
from collections.abc import Iterable

from .browser import Browser


Expand Down