File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 99# this makes them available
1010globals ().update (importlib .import_module ("cv2.cv2" ).__dict__ )
1111
12- is_ci_build = False
12+ ci_and_not_headless = False
1313
1414try :
15- from .version import ci_build
16- is_ci_build = ci_build
15+ from .version import ci_build , headless
16+
17+ ci_and_not_headless = ci_build and not headless
1718except :
1819 pass
1920
2021# the Qt plugin is included currently only in the pre-built wheels
21- if (sys .platform == "darwin" or sys .platform .startswith ("linux" )) and is_ci_build :
22+ if (
23+ sys .platform == "darwin" or sys .platform .startswith ("linux" )
24+ ) and ci_and_not_headless :
2225 os .environ ["QT_QPA_PLATFORM_PLUGIN_PATH" ] = os .path .join (
2326 os .path .dirname (os .path .abspath (__file__ )), "qt" , "plugins"
2427 )
28+
29+ # Qt will throw warning on Linux if fonts are not found
30+ if sys .platform .startswith ("linux" ) and ci_and_not_headless :
31+ os .environ ["QT_QPA_FONTDIR" ] = os .path .join (
32+ os .path .dirname (os .path .abspath (__file__ )), "qt" , "fonts"
33+ )
You can’t perform that action at this time.
0 commit comments