Belle II Software  light-2212-foldex
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 
29  ignoreonlinebook = 'online_book'
30 
31  ignoreaddtriggersimulation = 'add_trigger_simulation'
32 
33  ignoreaddsimulation = 'add_simulation'
34 
35  ignoreaddreconstruction = 'add_reconstruction'
36 
37  ignoreaddcdstoutput = 'add_cdst_output'
38 
39  ignorevalidationtools = 'validation_tools'
40 
41  ignoreincludeproblem = 'Problems with "include" directive path'
42 
43  ignoretrackmatching = 'trk_matching'
44 
45  ignoretrackingeventtimeextraction = 'tracking_eventtimeextraction'
46 
47  check_error_free("b2code-sphinx-warnings", "sphinx", None,
48  lambda x:
49  re.findall(ignoreaddsimulation, x) or
50  re.findall(ignoreaddtriggersimulation, x) or
51  re.findall(ignoreaddreconstruction, x) or
52  re.findall(ignoreaddcdstoutput, x) or
53  re.findall(ignorevalidationtools, x) or
54  re.findall(ignoreincludeproblem, x) or
55  re.findall(ignoreonlinebook, x) or
56  re.findall(ignoretrackmatching, x) or
57  re.findall(ignoretrackingeventtimeextraction, x),
58  ['--light']
59  )
60  if not light_build:
61  check_error_free("b2code-sphinx-warnings", "sphinx", None,
62  )