Skip to content

Commit 47f6883

Browse files
authored
chore: bump (#93)
- bump deps (incl. torchcodec) - pre-commit -> prek
1 parent b2489a1 commit 47f6883

24 files changed

+125
-97
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: setup ssh
20-
uses: webfactory/ssh-agent@v0.9.0
20+
uses: webfactory/ssh-agent@v0.9.1
2121
with:
2222
ssh-private-key: ${{ secrets.YAAK_IDL_REPO_SSH_KEY }}
2323

2424
- name: checkout
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626
with:
2727
submodules: recursive
2828
persist-credentials: false
2929
lfs: true
3030

3131
- name: setup just
32-
uses: extractions/setup-just@v2
32+
uses: extractions/setup-just@v3
3333

3434
- name: setup uv
3535
uses: astral-sh/setup-uv@v7
@@ -50,6 +50,6 @@ jobs:
5050
only: ytt
5151

5252
- name: install ffmpeg
53-
run: sudo apt update && sudo apt install -y ffmpeg
53+
run: sudo apt install -y ffmpeg
5454

5555
- run: just test

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: setup ssh
24-
uses: webfactory/ssh-agent@v0.9.0
24+
uses: webfactory/ssh-agent@v0.9.1
2525
with:
2626
ssh-private-key: ${{ secrets.YAAK_IDL_REPO_SSH_KEY }}
2727

2828
- name: checkout
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3030
with:
3131
submodules: recursive
3232
persist-credentials: false
@@ -44,7 +44,7 @@ jobs:
4444
needs: build
4545

4646
steps:
47-
- uses: actions/download-artifact@v4
47+
- uses: actions/download-artifact@v6
4848
with:
4949
name: Packages
5050
path: dist

.pre-commit-config.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
repos:
3+
- repo: builtin
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: check-added-large-files
7+
38
- repo: https://github.com/abravalheri/validate-pyproject
49
rev: v0.24.1
510
hooks:
@@ -11,24 +16,14 @@ repos:
1116
- id: pyupgrade
1217

1318
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.14.5
19+
rev: v0.14.7
1520
hooks:
1621
- id: ruff-check
1722
args: [--fix]
1823
- id: ruff-format
1924

20-
- repo: local
21-
# TODO: replace once available
22-
hooks:
23-
- id: ty
24-
name: ty check
25-
entry: uv run ty check
26-
language: system
27-
always_run: true
28-
pass_filenames: false
29-
3025
- repo: https://github.com/tombi-toml/tombi-pre-commit
31-
rev: v0.6.52
26+
rev: v0.7.0
3227
hooks:
3328
- id: tombi-format
3429
- id: tombi-lint
@@ -38,8 +33,28 @@ repos:
3833
hooks:
3934
- id: nbstripout
4035

36+
- repo: https://github.com/codespell-project/codespell
37+
rev: v2.4.1
38+
hooks:
39+
- id: codespell
40+
41+
- repo: https://github.com/hukkin/mdformat
42+
rev: 1.0.0
43+
hooks:
44+
- id: mdformat
45+
additional_dependencies:
46+
- mdformat-gfm
47+
4148
- repo: local
4249
hooks:
50+
# TODO: replace once available
51+
- id: ty
52+
name: ty check
53+
entry: uv run ty check
54+
language: system
55+
always_run: true
56+
pass_filenames: false
57+
4358
- id: just-format
4459
name: just-format
4560
language: system

LICENSE.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
7171
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7272
See the License for the specific language governing permissions and
7373
limitations under the License.
74-

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hatch_build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ class BuildYaakIdlProtosHook(BuildHookInterface):
3535
@override
3636
def clean(self, versions: list[str]) -> None:
3737
for path in self._get_yaak_idl_proto_paths():
38-
if path.exists():
39-
logger.warning("removing %s", path)
40-
path.unlink()
38+
path.unlink(missing_ok=True)
4139

4240
@override
4341
def initialize(self, version: str, build_data: dict[str, Any]) -> None:
@@ -78,4 +76,4 @@ def _build_yaak_idl_protos(cls) -> None:
7876
@staticmethod
7977
def _overwrite_callback(file: Path, text: str) -> None:
8078
logger.warning("overwriting %s", file)
81-
_ = file.write_text(text, encoding="utf-8")
79+
file.write_text(text, encoding="utf-8")

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sync:
1717
setup: sync
1818
git submodule update --init --recursive --force --remote
1919
git lfs pull
20-
uvx --with=pre-commit-uv pre-commit install --install-hooks
20+
uvx prek install
2121

2222
build:
2323
uv build
@@ -27,8 +27,8 @@ check:
2727
uv run ruff check
2828
uv run ty check
2929

30-
pre-commit *ARGS: build
31-
uvx --with=pre-commit-uv pre-commit run --all-files --color=always {{ ARGS }}
30+
prek *ARGS: build
31+
uvx prek --all-files {{ ARGS }}
3232

3333
generate-config:
3434
ytt --file {{ justfile_directory() }}/config/_templates \

pyproject.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rbyte"
3-
version = "0.34.1"
3+
version = "0.34.2"
44
description = "Multimodal PyTorch dataset library"
55
readme = "README.md"
66
requires-python = ">=3.12,<3.13"
@@ -24,10 +24,10 @@ dependencies = [
2424
"makefun>=1.16.0",
2525
"more-itertools>=10.8.0",
2626
"numpy",
27-
"optree>=0.17.0",
28-
"pipefunc[autodoc]>=0.87.1",
27+
"optree>=0.18.0",
28+
"pipefunc[autodoc]>=0.89.0",
2929
"polars==1.34.0", # https://github.com/pola-rs/polars/issues/25567
30-
"pydantic>=2.12.4",
30+
"pydantic>=2.12.5",
3131
"structlog>=25.4.0",
3232
"tensordict-nightly==2025.9.24", # https://github.com/pytorch/tensordict/issues/1440
3333
"torch",
@@ -45,12 +45,12 @@ rbyte-visualize = "rbyte.scripts.visualize:main"
4545

4646
[project.optional-dependencies]
4747
build = ["hatchling>=1.27.0"]
48-
geo = ["polars-st==0.4.0"]
48+
geo = ["polars-st==0.4.3"]
4949
hdf5 = ["h5py>=3.14.0"]
50-
jpeg = ["simplejpeg>=1.8.2"]
50+
jpeg = ["simplejpeg>=1.9.0"]
5151
mcap = ["mcap>=1.3.0", "mcap-protobuf-support>=0.5.3", "protobuf"]
5252
protos = ["grpcio-tools==1.71.0", "protoletariat>=3.3.10"]
53-
video = ["torchcodec>=0.7.0"]
53+
video = ["torchcodec>=0.8.1"]
5454
visualize = [
5555
"einops>=0.8.1",
5656
"rerun-sdk[notebook]>=0.27.2",
@@ -72,12 +72,12 @@ dev = [
7272
"wat-inspector>=0.4.3",
7373
]
7474
check = [
75-
"ruff>=0.14.5",
76-
"ty==0.0.1a21",
75+
"ruff>=0.14.6",
76+
"ty==0.0.1a31",
7777
]
7878
test = [
7979
"dill>=0.4.0",
80-
"pytest>=8.4.1",
80+
"pytest>=9.0.1",
8181
"pytest-lazy-fixtures>=1.4.0",
8282
"testbook>=0.4.2",
8383
]

src/rbyte/dataloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MapAndCollate[T]:
2828
def __init__(
2929
self,
3030
dataset: InstanceOf[BatchIndexableDataset],
31-
collate_fn: Callable[[list[T]], Any],
31+
collate_fn: Callable[[...], Any],
3232
) -> None:
3333
self._dataset = dataset
3434
self._collate_fn = collate_fn

src/rbyte/dataset.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
if streams is not None and (
6767
missing_stream_indexes := (
6868
{stream_config.index for stream_config in streams.values()}
69-
- (data_keys := data.keys())
69+
- (data_keys := set(data.keys()))
7070
)
7171
):
7272
logger.error(
@@ -119,7 +119,7 @@ def streams(self) -> StreamsConfig | None:
119119

120120
@override
121121
def __getitem__(self, index: int) -> Batch:
122-
return self.get_batch([index])[0]
122+
return self.get_batch([index])[0] # ty: ignore[invalid-return-type]
123123

124124
def __getitems__(self, index: Sequence[int]) -> Batch: # noqa: PLW3201
125125
return self.get_batch(index)
@@ -134,25 +134,25 @@ def get_batch(
134134
include_streams: bool | None = None,
135135
include_meta: bool = True,
136136
) -> Batch:
137-
data = self.data[index]
137+
data = self.data[index] # ty: ignore[invalid-argument-type]
138138
meta = self.meta[index]
139139

140140
match include_streams, self.streams:
141141
case None | True, dict():
142-
stream_data = {stream_id: [] for stream_id in self.streams}
142+
stream_data = {stream_id: [] for stream_id in self.streams} # ty: ignore[not-iterable]
143143

144144
for sample, input_id in zip(data, meta["input_id"], strict=True):
145-
for stream_id, stream_config in self.streams.items():
145+
for stream_id, stream_config in self.streams.items(): # ty: ignore[possibly-missing-attribute]
146146
stream_index = sample[stream_config.index].tolist()
147147
source = self._get_source(stream_id, input_id)
148148
stream_data[stream_id].append(source[stream_index])
149149

150150
stream_data = {k: torch.stack(v) for k, v in stream_data.items()}
151151

152-
if data.is_locked:
153-
data = data.clone(recurse=True)
152+
if data.is_locked: # ty: ignore[possibly-missing-attribute]
153+
data = data.clone(recurse=True) # ty: ignore[unknown-argument]
154154

155-
data = data.update(stream_data, inplace=False)
155+
data = data.update(stream_data, inplace=False) # ty: ignore[possibly-missing-attribute]
156156

157157
case True, None:
158158
msg = "`include_streams` is True but no streams specified"
@@ -173,6 +173,10 @@ def get_batch(
173173

174174
@cachedmethod(lambda self: self._stream_source_cache)
175175
def _get_source(self, stream_id: str, input_id: str) -> TensorSource:
176+
if self.streams is None:
177+
msg = "streams not specified"
178+
raise RuntimeError(msg)
179+
176180
return self.streams[stream_id].sources[input_id].instantiate()
177181

178182
@classmethod
@@ -194,7 +198,7 @@ def _build_samples(
194198
)
195199

196200
output_name = pipeline.unique_leaf_node.output_name
197-
results = pipeline.map( # ty: ignore[missing-argument]
201+
results = pipeline.map(
198202
executor=executor, **samples.model_dump(exclude={"pipeline", "executor"})
199203
)
200204

0 commit comments

Comments
 (0)