From 0bfc6bf15e2de8e42a5c5579bdad3399b5138f24 Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Thu, 26 Jun 2025 00:21:48 -0400 Subject: [PATCH 1/2] Get rid of setup.py warning --- setup.py | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/setup.py b/setup.py index d5ad4fb31..16ca7f59b 100644 --- a/setup.py +++ b/setup.py @@ -6,30 +6,19 @@ import shlex import subprocess import sys -from time import sleep + +if platform.system() == "Darwin": + major_version = int(platform.mac_ver()[0].split(".")[0]) + if major_version < 12: + raise OSError("You are using an EOL, unsupported, and out-of-date OS.") def is_virtualenv(): return sys.base_prefix != sys.prefix -if platform.system() == "Darwin": - major_version = int(platform.mac_ver()[0].split(".")[0]) - if major_version < 12: - print( - "\033[1;91mWarning!\033[0m You are using an EOL, unsupported, and out-of-date OS." - ) - sleep(3) - -print( - "\n\033[1;91mWarning!\033[0m You are installing from source.\n" - "It is \033[1;37mEXPECTED\033[0m that it will fail. You are \033[1;37mREQUIRED\033[0m" - " to use ffmpeg 7.\nYou \033[1;37mMUST\033[0m have Cython, pkg-config, and a C compiler.\n" -) -if os.getenv("GITHUB_ACTIONS") == "true" or is_virtualenv(): - pass -else: - print("\033[1;91mWarning!\033[0m You are not using a virtual environment") +if not (os.getenv("GITHUB_ACTIONS") == "true" or is_virtualenv()): + raise ValueError("You are not using a virtual environment") from Cython.Build import cythonize @@ -159,16 +148,10 @@ def parse_cflags(raw_flags): FFMPEG_DIR = arg.split("=")[1] del sys.argv[i] -# Do not cythonize or use pkg-config when cleaning. -use_pkg_config = platform.system() != "Windows" -if len(sys.argv) > 1 and sys.argv[1] == "clean": - cythonize = lambda ext, **kwargs: [ext] - use_pkg_config = False - # Locate ffmpeg libraries and headers. if FFMPEG_DIR is not None: extension_extra = get_config_from_directory(FFMPEG_DIR) -elif use_pkg_config: +elif platform.system() != "Windows": extension_extra = get_config_from_pkg_config() else: extension_extra = { From 7e615c122e2737d6024e77f74bf7058b8be1bbaf Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Thu, 26 Jun 2025 00:30:58 -0400 Subject: [PATCH 2/2] Fix this warning: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/av/video/frame.c: In function ‘__pyx_f_2av_5video_5frame_copy_bytes_to_plane’: src/av/video/frame.c:18808:41: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 18808 | for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_16; __pyx_t_15+=1) { | --- av/video/frame.py | 1 - 1 file changed, 1 deletion(-) diff --git a/av/video/frame.py b/av/video/frame.py index bc4bf9154..970ecc4b8 100644 --- a/av/video/frame.py +++ b/av/video/frame.py @@ -155,7 +155,6 @@ def copy_bytes_to_plane( end_row = plane.height step = 1 - i, j = cython.declare(cython.int) for row in range(start_row, end_row, step): i_pos = row * i_stride if flip_horizontal: