diff --git a/setup.py b/setup.py index 685412b99..3d4c11fac 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,31 @@ import shlex import subprocess import sys +from time import sleep + + +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) + +# Don't show message when using our project tooling. +if not is_virtualenv() or os.getenv("_PYAV_ACTIVATED", "") != "1": + 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": + sleep(3) + from Cython.Build import cythonize from Cython.Compiler.AutoDocTransforms import EmbedSignature @@ -141,7 +166,7 @@ def parse_cflags(raw_flags): cythonize = lambda ext, **kwargs: [ext] use_pkg_config = False -# Locate FFmpeg libraries and headers. +# Locate ffmpeg libraries and headers. if FFMPEG_DIR is not None: extension_extra = get_config_from_directory(FFMPEG_DIR) elif use_pkg_config: