Belle II Software  release-06-02-00
sphinx.py
1 #!/usr/bin/env python3
2 
3 
10 
11 """
12 Create sphinx documentation and make sure that there are no warnings.
13 However, a few warnings can not easily be omitted and are therefore accepted for now.
14 """
15 
16 import re
17 from b2test_utils import check_error_free
18 
19 
20 light_build = False
21 try:
22  import generators # noqa
23 except ModuleNotFoundError:
24  light_build = True
25 
26 if __name__ == "__main__":
27 
28  ignoreenvironmentvariables = 'envvar'
29 
30  ignorepythonclass = 'py:class reference target not found'
31 
32  ignoreduplicatewhatsnewlabel = 'duplicate label whatsnew:'
33 
34  ignoreduplicatedescriptionofrole = 'duplicate description of role'
35 
37  ignoreonlinebook = 'online_book'
38 
39  ignoreaddtriggersimulation = 'add_trigger_simulation'
40 
41  ignoreaddsimulation = 'add_simulation'
42 
43  ignoreaddreconstruction = 'add_reconstruction'
44 
45  ignoreaddcdstoutput = 'add_cdst_output'
46 
47  ignorevalidationtools = 'validation_tools'
48 
49  ignoreincludeproblem = 'Problems with "include" directive path'
50 
51  check_error_free("b2code-sphinx-warnings", "sphinx", None,
52  lambda x:
53  re.findall(ignoreenvironmentvariables, x) or
54  re.findall(ignorepythonclass, x) or
55  re.findall(ignoreduplicatewhatsnewlabel, x) or
56  re.findall(ignoreduplicatedescriptionofrole, x) or
57  re.findall(ignoreaddsimulation, x) or
58  re.findall(ignoreaddtriggersimulation, x) or
59  re.findall(ignoreaddreconstruction, x) or
60  re.findall(ignoreaddcdstoutput, x) or
61  re.findall(ignorevalidationtools, x) or
62  re.findall(ignoreincludeproblem, x) or
63  re.findall(ignoreonlinebook, x),
64  ['--light']
65  )
66  if not light_build:
67  check_error_free("b2code-sphinx-warnings", "sphinx", None,
68  lambda x:
69  re.findall(ignoreenvironmentvariables, x) or
70  re.findall(ignorepythonclass, x) or
71  re.findall(ignoreduplicatewhatsnewlabel, x) or
72  re.findall(ignoreduplicatedescriptionofrole, x)
73  )