From d866aa58dac2af639ea6f1f04e65c27f498f7376 Mon Sep 17 00:00:00 2001 From: Daniel Flores Date: Mon, 24 Nov 2025 13:27:26 -0500 Subject: [PATCH] add get_python_version, skip marks --- test/test_decoders.py | 5 +++++ test/test_ops.py | 5 +++++ test/utils.py | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/test/test_decoders.py b/test/test_decoders.py index 2744d2cf3..3c13921e0 100644 --- a/test/test_decoders.py +++ b/test/test_decoders.py @@ -29,6 +29,7 @@ BT709_FULL_RANGE, cuda_version_used_for_building_torch, get_ffmpeg_major_version, + get_python_version, H264_10BITS, H265_10BITS, H265_VIDEO, @@ -1146,6 +1147,10 @@ def test_get_key_frame_indices(self, device): # TODO investigate why this fails internally. @pytest.mark.skipif(in_fbcode(), reason="Compile test fails internally.") + @pytest.mark.skipif( + get_python_version() >= (3, 14), + reason="torch.compile is not supported on Python 3.14+", + ) @pytest.mark.parametrize("device", all_supported_devices()) def test_compile(self, device): decoder, device = make_video_decoder(NASA_VIDEO.path, device=device) diff --git a/test/test_ops.py b/test/test_ops.py index 3bd46c4e3..baecc2b54 100644 --- a/test/test_ops.py +++ b/test/test_ops.py @@ -42,6 +42,7 @@ from .utils import ( all_supported_devices, assert_frames_equal, + get_python_version, in_fbcode, NASA_AUDIO, NASA_AUDIO_MP3, @@ -368,6 +369,10 @@ def test_throws_exception_if_seek_too_far(self, device): with pytest.raises(IndexError, match="no more frames"): get_next_frame(decoder) + @pytest.mark.skipif( + get_python_version() >= (3, 14), + reason="torch.compile is not supported on Python 3.14+", + ) @pytest.mark.parametrize("device", all_supported_devices()) def test_compile_seek_and_next(self, device): # TODO_OPEN_ISSUE Scott (T180277797): Get this to work with the inductor stack. Right now diff --git a/test/utils.py b/test/utils.py index 43f29cf5a..5f6521938 100644 --- a/test/utils.py +++ b/test/utils.py @@ -97,6 +97,10 @@ def get_ffmpeg_minor_version(): return int(ffmpeg_version.split(".")[1]) +def get_python_version() -> tuple[int, int]: + return (sys.version_info.major, sys.version_info.minor) + + def cuda_version_used_for_building_torch() -> Optional[tuple[int, int]]: # Return the CUDA version that was used to build PyTorch. That's not always # the same as the CUDA version that is currently installed on the running