Skip to content

Commit 9e3831a

Browse files
committed
Add warnings when compiling from source
1 parent 0eca76e commit 9e3831a

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

setup.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@
66
import shlex
77
import subprocess
88
import sys
9+
from time import sleep
10+
11+
12+
def is_virtualenv():
13+
return sys.base_prefix != sys.prefix
14+
15+
16+
if platform.system() == "Darwin":
17+
major_version = int(platform.mac_ver()[0].split(".")[0])
18+
if major_version < 12:
19+
print(
20+
"\033[1;91mWarning!\033[0m You are using an EOL, unsupported, and out-of-date OS."
21+
)
22+
sleep(3)
23+
24+
# Don't show message when using our project tooling.
25+
if not is_virtualenv() or os.environ.get("_PYAV_ACTIVATED", "") != "1":
26+
print(
27+
"\n\033[1;91mWarning!\033[0m You are installing from source.\n"
28+
"It is \033[1;37mEXPECTED\033[0m that it will fail. You are \033[1;37mREQUIRED\033[0m"
29+
" to use ffmpeg 7.\nYou \033[1;37mMUST\033[0m have Cython, pkg-config, and a C compiler.\n"
30+
)
31+
sleep(3)
32+
933

1034
from Cython.Build import cythonize
1135
from Cython.Compiler.AutoDocTransforms import EmbedSignature

0 commit comments

Comments
 (0)