|
9 | 9 | # this makes them available |
10 | 10 | globals().update(importlib.import_module("cv2.cv2").__dict__) |
11 | 11 |
|
12 | | -is_ci_build=False |
| 12 | +ci_and_not_headless=False |
13 | 13 |
|
14 | 14 | try: |
15 | | -from .versionimportci_build |
16 | | -is_ci_build=ci_build |
| 15 | +from .versionimportci_build,headless |
| 16 | + |
| 17 | +ci_and_not_headless=ci_buildandnotheadless |
17 | 18 | except: |
18 | 19 | pass |
19 | 20 |
|
20 | 21 | # the Qt plugin is included currently only in the pre-built wheels |
21 | | -if (sys.platform=="darwin"orsys.platform.startswith("linux"))andis_ci_build: |
| 22 | +if ( |
| 23 | +sys.platform=="darwin"orsys.platform.startswith("linux") |
| 24 | +)andci_and_not_headless: |
22 | 25 | os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"]=os.path.join( |
23 | 26 | os.path.dirname(os.path.abspath(__file__)),"qt","plugins" |
24 | 27 | ) |
| 28 | + |
| 29 | +# Qt will throw warning on Linux if fonts are not found |
| 30 | +ifsys.platform.startswith("linux")andci_and_not_headless: |
| 31 | +os.environ["QT_QPA_FONTDIR"]=os.path.join( |
| 32 | +os.path.dirname(os.path.abspath(__file__)),"qt","fonts" |
| 33 | + ) |