| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
from __future__ import print_function |
| 11 |
import sys |
| 12 |
|
| 13 |
missing_deps = [] |
| 14 |
|
| 15 |
def eprint(*args, **kwargs): |
| 16 |
print(*args, file=sys.stderr, **kwargs) |
| 17 |
|
| 18 |
def missing_dep(dep): |
| 19 |
missing_deps.append(dep) |
| 20 |
|
| 21 |
def report_missing_deps(): |
| 22 |
if len(missing_deps) > 0: |
| 23 |
deps = " ".join(missing_deps) |
| 24 |
eprint('Cannot find package(s) `%s` (needed to build documentation)' % deps) |
| 25 |
eprint('You can run `pip3 install %s` to install it/them.' % deps) |
| 26 |
sys.exit(1) |
| 27 |
|
| 28 |
try: |
| 29 |
import sphinx_rtd_theme |
| 30 |
except: |
| 31 |
missing_dep('sphinx_rtd_theme') |
| 32 |
|
| 33 |
try: |
| 34 |
import pexpect |
| 35 |
except: |
| 36 |
missing_dep('pexpect') |
| 37 |
|
| 38 |
try: |
| 39 |
import antlr4 |
| 40 |
except: |
| 41 |
missing_dep('antlr4-python3-runtime') |
| 42 |
|
| 43 |
try: |
| 44 |
import bs4 |
| 45 |
except: |
| 46 |
missing_dep('beautifulsoup4') |
| 47 |
|
| 48 |
try: |
| 49 |
import sphinxcontrib.bibtex |
| 50 |
except: |
| 51 |
missing_dep('sphinxcontrib-bibtex') |
| 52 |
|
| 53 |
report_missing_deps() |