Skip to content

Commit d866aa5

Browse files
committed
add get_python_version, skip marks
1 parent e202226 commit d866aa5

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

test/test_decoders.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
BT709_FULL_RANGE,
3030
cuda_version_used_for_building_torch,
3131
get_ffmpeg_major_version,
32+
get_python_version,
3233
H264_10BITS,
3334
H265_10BITS,
3435
H265_VIDEO,
@@ -1146,6 +1147,10 @@ def test_get_key_frame_indices(self, device):
11461147

11471148
# TODO investigate why this fails internally.
11481149
@pytest.mark.skipif(in_fbcode(), reason="Compile test fails internally.")
1150+
@pytest.mark.skipif(
1151+
get_python_version() >= (3, 14),
1152+
reason="torch.compile is not supported on Python 3.14+",
1153+
)
11491154
@pytest.mark.parametrize("device", all_supported_devices())
11501155
def test_compile(self, device):
11511156
decoder, device = make_video_decoder(NASA_VIDEO.path, device=device)

test/test_ops.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from .utils import (
4343
all_supported_devices,
4444
assert_frames_equal,
45+
get_python_version,
4546
in_fbcode,
4647
NASA_AUDIO,
4748
NASA_AUDIO_MP3,
@@ -368,6 +369,10 @@ def test_throws_exception_if_seek_too_far(self, device):
368369
with pytest.raises(IndexError, match="no more frames"):
369370
get_next_frame(decoder)
370371

372+
@pytest.mark.skipif(
373+
get_python_version() >= (3, 14),
374+
reason="torch.compile is not supported on Python 3.14+",
375+
)
371376
@pytest.mark.parametrize("device", all_supported_devices())
372377
def test_compile_seek_and_next(self, device):
373378
# TODO_OPEN_ISSUE Scott (T180277797): Get this to work with the inductor stack. Right now

test/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ def get_ffmpeg_minor_version():
9797
return int(ffmpeg_version.split(".")[1])
9898

9999

100+
def get_python_version() -> tuple[int, int]:
101+
return (sys.version_info.major, sys.version_info.minor)
102+
103+
100104
def cuda_version_used_for_building_torch() -> Optional[tuple[int, int]]:
101105
# Return the CUDA version that was used to build PyTorch. That's not always
102106
# the same as the CUDA version that is currently installed on the running

0 commit comments

Comments
 (0)