Skip to content

Commit 9fdb3e6

Browse files
authored
feat: py, textual, awkward bump (#188)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 184dafe commit 9fdb3e6

File tree

8 files changed

+18
-51
lines changed

8 files changed

+18
-51
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python-version: ["3.8", "3.11"]
33+
python-version: ["3.9", "3.11"]
3434
runs-on: [ubuntu-latest, macos-13, windows-latest]
3535
include:
3636
- python-version: "3.13"

pyproject.toml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ authors = [
1010
maintainers = [
1111
{ name = "The Scikit-HEP admins", email = "[email protected]" },
1212
]
13-
license = { file = "LICENSE" }
1413

1514
description = "Tools to inspect ROOT files with uproot"
1615
readme = "README.md"
1716

18-
requires-python = ">=3.8"
17+
requires-python = ">=3.9"
1918

2019
classifiers = [
2120
"License :: OSI Approved :: BSD License",
@@ -26,7 +25,6 @@ classifiers = [
2625
"License :: OSI Approved :: BSD License",
2726
"Programming Language :: Python",
2827
"Programming Language :: Python :: 3",
29-
"Programming Language :: Python :: 3.8",
3028
"Programming Language :: Python :: 3.9",
3129
"Programming Language :: Python :: 3.10",
3230
"Programming Language :: Python :: 3.11",
@@ -38,16 +36,15 @@ classifiers = [
3836

3937
dynamic = ["version"]
4038
dependencies = [
41-
'awkward >=1',
39+
'awkward >=2',
4240
'click >=8',
4341
'click-default-group >=1.2',
4442
'hist >=2.4',
45-
'importlib_resources; python_version<"3.9"',
4643
'lz4>=2',
47-
'numpy >=1.13.3',
44+
'numpy >=1.18',
4845
'plotext >=5.2.8',
4946
'rich >=13.3.3',
50-
'textual >=0.18.0',
47+
'textual >=0.86.0',
5148
'uproot >=5',
5249
]
5350

@@ -81,20 +78,13 @@ dev = [
8178
version.source = "vcs"
8279
build.hooks.vcs.version-file = "src/uproot_browser/_version.py"
8380

84-
[tool.uv]
85-
environments = [
86-
"python_version >= '3.11'",
87-
]
88-
8981
[tool.pytest.ini_options]
90-
minversion = "6.0"
82+
minversion = "8.0"
9183
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
9284
xfail_strict = true
9385
filterwarnings = [
9486
"error",
9587
"ignore:can't resolve package from __spec__ or __package__, falling back on __name__ and __path__:ImportWarning", # PyPy NumPy
96-
"ignore:module 'sre_.*' is deprecated:DeprecationWarning:awkward", # Awkward 1
97-
"ignore: pkg_resources is deprecated as an API:DeprecationWarning:uproot", # Uproot 4
9888
]
9989
log_cli_level = "info"
10090
testpaths = ["tests"]
@@ -104,7 +94,7 @@ asyncio_default_fixture_loop_scope = "function"
10494

10595
[tool.mypy]
10696
files = "src"
107-
python_version = "3.8"
97+
python_version = "3.9"
10898
warn_unused_configs = true
10999
strict = true
110100

@@ -114,7 +104,7 @@ ignore_missing_imports = true
114104

115105

116106
[tool.pylint]
117-
master.py-version = "3.8"
107+
master.py-version = "3.9"
118108
master.jobs = "0"
119109
reports.output-format = "colorized"
120110
similarities.ignore-imports = "yes"

src/uproot_browser/_compat/__init__.py

Whitespace-only changes.

src/uproot_browser/_compat/importlib/__init__.py

Whitespace-only changes.

src/uproot_browser/_compat/importlib/resources.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/uproot_browser/plot_mpl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import hist
1212
import matplotlib.pyplot as plt
1313
import uproot
14+
import uproot.behaviors.TH1
1415

1516
import uproot_browser.plot
1617

src/uproot_browser/tui/browser.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def action_quit_with_dump(self) -> None:
122122
assert err_widget.exc
123123
items = [err_widget.exc]
124124

125-
dark = self.dark if hasattr(self, "dark") else self.theme != "textual-light" # type: ignore[has-type]
125+
dark = self.theme != "textual-light"
126126

127127
theme = "ansi_dark" if dark else "ansi_light"
128128

@@ -135,28 +135,20 @@ def action_quit_with_dump(self) -> None:
135135

136136
def action_toggle_theme(self) -> None:
137137
"""An action to toggle dark mode."""
138-
if hasattr(self, "dark"):
139-
# pylint: disable-next=access-member-before-definition
140-
dark = not self.dark # type: ignore[has-type]
141-
if self.plot_widget.item:
142-
self.plot_widget.item.theme = "dark" if dark else "default"
143-
# pylint: disable-next=attribute-defined-outside-init
144-
self.dark = dark
145-
else:
146-
dark = self.theme != "textual-light"
147-
theme = "textual-light" if dark else "textual-dark"
138+
dark = self.theme != "textual-light"
139+
theme = "textual-light" if dark else "textual-dark"
148140

149-
if self.plot_widget.item:
150-
self.plot_widget.item.theme = "dark" if dark else "default"
151-
self.theme = theme
141+
if self.plot_widget.item:
142+
self.plot_widget.item.theme = "dark" if dark else "default"
143+
self.theme = theme
152144

153145
def on_uproot_selected(self, message: UprootSelected) -> None:
154146
"""A message sent by the tree when a file is clicked."""
155147

156148
content_switcher = self.query_one("#main-view", textual.widgets.ContentSwitcher)
157149

158150
try:
159-
dark = self.dark if hasattr(self, "dark") else self.theme != "textual-light"
151+
dark = self.theme != "textual-light"
160152
theme = "dark" if dark else "default"
161153
make_plot(message.upfile[message.path], theme, 20)
162154
self.plot_widget.item = Plotext(message.upfile, message.path, theme)

src/uproot_browser/tui/help.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import typing
4+
from importlib.resources import files
45
from typing import ClassVar
56

67
import textual.app
@@ -12,15 +13,8 @@
1213
if typing.TYPE_CHECKING:
1314
from .browser import Browser
1415

15-
# 0.18's ModalScreen is not subscriptable. Later versions are.
16-
ModalScreen = textual.screen.ModalScreen[None]
17-
else:
18-
ModalScreen = textual.screen.ModalScreen
1916

20-
from .._compat.importlib.resources import files
21-
22-
23-
class HelpScreen(ModalScreen):
17+
class HelpScreen(textual.screen.ModalScreen[None]):
2418
BINDINGS: ClassVar[
2519
list[textual.binding.Binding | tuple[str, str] | tuple[str, str, str]]
2620
] = [

0 commit comments

Comments
 (0)