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