Skip to content

Commit 3ac2034

Browse files
InfantLabclaude
andcommitted
fix: pin torch trio to 2.6.0 and make read-only test portable
Pin torch/torchvision/torchaudio to the matched 2.6.0 release so macOS and Windows (which resolve from PyPI) don't float to torchaudio >=2.9, which removed AudioMetaData and broke pipeline imports. Linux still gets the +cu124 build via tool.uv.sources. Also skip test_readonly_directory on Windows and when running as root (where filesystem permission bits are unreliable/bypassed), and accept the PermissionError whether it surfaces during backend construction or the write. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent cd529e9 commit 3ac2034

3 files changed

Lines changed: 108 additions & 120 deletions

File tree

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ dependencies = [
4646
"ultralytics>=8.3.0",
4747
"supervision>=0.16.0",
4848
# Note: PyTorch with CUDA - Use UV_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu124 for CUDA builds
49-
"torch>=2.0.0",
50-
"torchvision>=0.15.0",
49+
# Pin the torch trio to a matched, tested release. cu124 build on Linux
50+
# (via tool.uv.sources); CPU build from PyPI on macOS/Windows. Newer
51+
# torchaudio (>=2.9) removed AudioMetaData, which the pipelines rely on.
52+
"torch==2.6.0",
53+
"torchvision==0.21.0",
5154
"timm>=0.9.0",
5255
# Audio processing - Core packages that should work
5356
"pyannote.audio>=3.3.2",
5457
"pyannote.core>=5.0.0",
5558
"pyannote.database>=5.1.0",
5659
"pyannote.metrics>=3.2.1",
5760
"pyannote.pipeline>=3.0.1",
58-
"torchaudio>=2.0.0",
61+
"torchaudio==2.6.0",
5962
# Scene detection and video understanding
6063
"scenedetect[opencv]>=0.6.3",
6164
"transformers>=4.40.0",

tests/integration/test_batch_storage.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
import json
8+
import os
89
import tempfile
910
from pathlib import Path
1011
from unittest.mock import mock_open, patch
@@ -283,6 +284,10 @@ def test_save_job_invalid_data(self):
283284
# Expected for invalid data
284285
pass
285286

287+
@pytest.mark.skipif(
288+
os.name == "nt" or (hasattr(os, "geteuid") and os.geteuid() == 0),
289+
reason="read-only directory enforcement is unreliable on Windows and bypassed by root",
290+
)
286291
def test_readonly_directory(self):
287292
"""Test behavior with read-only directory."""
288293
# Create storage in temp directory
@@ -293,14 +298,13 @@ def test_readonly_directory(self):
293298
# Make directory read-only
294299
readonly_dir.chmod(0o444)
295300

296-
# Try to create storage backend
297-
# This should handle the permission issue gracefully
298-
storage = FileStorageBackend(readonly_dir)
299-
300-
# Basic operations should fail gracefully
301+
# Operating on a read-only directory should raise PermissionError,
302+
# whether it surfaces while creating the backend's subdirectories or
303+
# while writing job metadata.
301304
job = BatchJob(video_path=Path("test_video.mp4"))
302305

303306
with pytest.raises(PermissionError):
307+
storage = FileStorageBackend(readonly_dir)
304308
storage.save_job_metadata(job)
305309

306310
finally:

0 commit comments

Comments
 (0)