diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dbf712c..1fe8851 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: files: src additional_dependencies: - rich>=12 - - click>=8.1.1 + - click==8.1.3 - hist - numpy - textual>=0.27 diff --git a/src/uproot_browser/tui/browser.py b/src/uproot_browser/tui/browser.py index 4cb5c1a..42d4bb5 100644 --- a/src/uproot_browser/tui/browser.py +++ b/src/uproot_browser/tui/browser.py @@ -6,7 +6,7 @@ import contextlib import sys from pathlib import Path -from typing import Any +from typing import Any, ClassVar import plotext as plt import rich.syntax @@ -53,7 +53,9 @@ class Browser(textual.app.App[object]): """A basic implementation of the uproot-browser TUI""" CSS_PATH = "browser.css" - BINDINGS = [ + BINDINGS: ClassVar[ + list[textual.binding.Binding | tuple[str, str] | tuple[str, str, str]] + ] = [ textual.binding.Binding("b", "toggle_files", "Navbar"), textual.binding.Binding("q", "quit", "Quit"), textual.binding.Binding("d", "quit_with_dump", "Dump & Quit"), diff --git a/src/uproot_browser/tui/help.py b/src/uproot_browser/tui/help.py index 5104933..1f970c0 100644 --- a/src/uproot_browser/tui/help.py +++ b/src/uproot_browser/tui/help.py @@ -1,6 +1,7 @@ from __future__ import annotations import typing +from typing import ClassVar import textual.app import textual.binding @@ -20,7 +21,9 @@ class HelpScreen(ModalScreen): - BINDINGS = [ + BINDINGS: ClassVar[ + list[textual.binding.Binding | tuple[str, str] | tuple[str, str, str]] + ] = [ textual.binding.Binding("d", "", "Nothing", show=False), textual.binding.Binding("b", "", "Nothing", show=False), textual.binding.Binding("f1", "", "Nothing", show=False), diff --git a/src/uproot_browser/tui/left_panel.py b/src/uproot_browser/tui/left_panel.py index 78c3e14..5cd734d 100644 --- a/src/uproot_browser/tui/left_panel.py +++ b/src/uproot_browser/tui/left_panel.py @@ -1,7 +1,7 @@ from __future__ import annotations from pathlib import Path -from typing import Any +from typing import Any, ClassVar import rich.panel import rich.repr @@ -28,7 +28,9 @@ def __init__(self, upfile: Any, path: str) -> None: class UprootTree(textual.widgets.Tree[UprootEntry]): """currently just extending DirectoryTree, showing current path""" - BINDINGS = [ + BINDINGS: ClassVar[ + list[textual.binding.Binding | tuple[str, str] | tuple[str, str, str]] + ] = [ textual.binding.Binding("h", "cursor_out", "Cursor out", show=False), textual.binding.Binding("j", "cursor_down", "Cursor Down", show=False), textual.binding.Binding("k", "cursor_up", "Cursor Up", show=False),