Debian Codegraph @

doc/tools/rocqrst/checkdeps.py

raw symbols SCIP
1 ##########################################################################
2 ## # The Rocq Prover / The Rocq Development Team ##
3 ## v # Copyright INRIA, CNRS and contributors ##
4 ## <O___,, # (see version control and CREDITS file for authors & dates) ##
5 ## \VV/ ###############################################################
6 ## // # This file is distributed under the terms of the ##
7 ## # GNU Lesser General Public License Version 2.1 ##
8 ## # (see LICENSE file for the text of the license) ##
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()