18
18
# absolute, like shown here.
19
19
# sys.path.append(os.path.abspath('some/directory'))
20
20
21
-
22
21
import os
23
- import sys
24
22
import pytensor
25
23
26
- pytensor_path = os .path .join (os .path .dirname (__file__ ), os .pardir )
27
- sys .path .append (os .path .abspath (pytensor_path ))
28
- import versioneer
29
-
30
24
# General configuration
31
25
# ---------------------
32
26
38
32
"sphinx.ext.doctest" ,
39
33
"sphinx.ext.napoleon" ,
40
34
"sphinx.ext.linkcode" ,
35
+ "sphinx.ext.mathjax" ,
41
36
]
42
37
38
+ needs_sphinx = "3"
39
+
43
40
todo_include_todos = True
44
41
napoleon_google_docstring = False
45
42
napoleon_include_special_with_doc = False
46
43
47
- # We do it like this to support multiple sphinx version without having warning.
48
- # Our buildbot consider warning as error.
49
- try :
50
- from sphinx .ext import imgmath
51
-
52
- extensions .append ("sphinx.ext.imgmath" )
53
- except ImportError :
54
- try :
55
- from sphinx .ext import pngmath
56
-
57
- extensions .append ("sphinx.ext.pngmath" )
58
- except ImportError :
59
- pass
60
-
61
-
62
44
# Add any paths that contain templates here, relative to this directory.
63
45
templates_path = [".templates" ]
64
46
70
52
71
53
# General substitutions.
72
54
project = "PyTensor"
73
- copyright = "PyTensor Developers, 2021; PyMC Developers, 2020- 2021; 2008--2019, LISA lab "
55
+ copyright = "PyMC Team 2022-present,2020- 2021; Aesara Developers, 2021-2022; LISA Lab, 2008--2019"
74
56
75
57
# The default replacements for |version| and |release|, also used in various
76
58
# other places throughout the built documents.
77
59
#
78
60
79
- # We need this hokey-pokey because versioneer needs the current
80
- # directory to be the root of the project to work.
81
- _curpath = os .getcwd ()
82
- os .chdir (os .path .dirname (os .path .dirname (__file__ )))
61
+ version = pytensor .__version__
62
+ if os .environ .get ("READTHEDOCS" , False ):
63
+ rtd_version = os .environ .get ("READTHEDOCS_VERSION" , "" )
64
+ if rtd_version .lower () == "stable" :
65
+ version = pymc .__version__ .split ("+" )[0 ]
66
+ elif rtd_version .lower () == "latest" :
67
+ version = "dev"
68
+ else :
69
+ version = rtd_version
70
+ else :
71
+ rtd_version = "local"
83
72
# The full version, including alpha/beta/rc tags.
84
- release = versioneer .get_version ()
85
- # The short X.Y version.
86
- version = "." .join (release .split ("." )[:2 ])
87
- os .chdir (_curpath )
88
- del _curpath
73
+ release = version
89
74
90
75
# There are two options for replacing |today|: either, you set today to some
91
76
# non-false value, then it is used:
132
117
# https://github.com/readthedocs/sphinx_rtd_theme/issues/766#issuecomment-513852197
133
118
html4_writer = True
134
119
135
- # Read the docs style:
136
- if os .environ .get ("READTHEDOCS" ) != "True" :
137
- try :
138
- import sphinx_rtd_theme
139
- except ImportError :
140
- pass # assume we have sphinx >= 1.3
141
- else :
142
- html_theme_path = [sphinx_rtd_theme .get_html_theme_path ()]
143
- html_theme = "sphinx_rtd_theme"
144
-
145
-
146
- def setup (app ):
147
- app .add_css_file ("fix_rtd.css" )
120
+ html_logo = "images/pytensor_logo.svg"
121
+ html_theme = "pymc_sphinx_theme"
122
+ html_theme_options = {
123
+ "use_search_override" : False ,
124
+ }
125
+ html_context = {
126
+ "github_user" : "pymc-devs" ,
127
+ "github_repo" : "pytensor" ,
128
+ "github_version" : "main" ,
129
+ "doc_path" : "doc" ,
130
+ "default_mode" : "light" ,
131
+ }
148
132
149
133
150
134
# The name for this set of Sphinx documents. If None, it defaults to
@@ -166,7 +150,7 @@ def setup(app):
166
150
# Add any paths that contain custom static files (such as style sheets) here,
167
151
# relative to this directory. They are copied after the builtin static files,
168
152
# so a file named "default.css" will overwrite the builtin "default.css".
169
- html_static_path = [".static" , " images" , "library/d3viz/examples" ]
153
+ html_static_path = ["images" , "library/d3viz/examples" ]
170
154
171
155
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
172
156
# using the given strftime format.
0 commit comments