|
30 | 30 | import sys |
31 | 31 |
|
32 | 32 | import matplotlib |
33 | | -matplotlib.use('agg') |
| 33 | + |
| 34 | +matplotlib.use("agg") |
34 | 35 |
|
35 | 36 | try: |
36 | 37 | from sphinx_astropy.conf.v1 import * |
37 | 38 | except ImportError: |
38 | | - print('ERROR: the documentation requires the sphinx-astropy package to be' |
39 | | - ' installed') |
| 39 | + print( |
| 40 | + "ERROR: the documentation requires the sphinx-astropy package to be" |
| 41 | + " installed" |
| 42 | + ) |
40 | 43 | sys.exit(1) |
41 | 44 |
|
42 | 45 | # Get configuration information from setup.cfg |
43 | 46 | from configparser import ConfigParser # noqa: E402 |
| 47 | + |
44 | 48 | conf = ConfigParser() |
45 | 49 |
|
46 | | -conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')]) |
47 | | -setup_cfg = dict(conf.items('metadata')) |
| 50 | +conf.read([os.path.join(os.path.dirname(__file__), "..", "setup.cfg")]) |
| 51 | +setup_cfg = dict(conf.items("metadata")) |
48 | 52 |
|
49 | 53 | # -- General configuration ---------------------------------------------------- |
50 | 54 |
|
51 | 55 | # By default, highlight as Python 3. |
52 | | -highlight_language = 'python3' |
| 56 | +highlight_language = "python3" |
53 | 57 |
|
54 | 58 | # If your documentation needs a minimal Sphinx version, state it here. |
55 | 59 | # needs_sphinx = '1.2' |
|
60 | 64 |
|
61 | 65 | # List of patterns, relative to source directory, that match files and |
62 | 66 | # directories to ignore when looking for source files. |
63 | | -exclude_patterns.append('_templates') |
| 67 | +exclude_patterns.append("_templates") |
64 | 68 |
|
65 | 69 | # This is added to the end of RST files - a good place to put substitutions to |
66 | 70 | # be used globally. |
67 | | -rst_epilog += """ |
68 | | -""" |
| 71 | +with open("substitutions.txt") as inf: |
| 72 | + rst_epilog += inf.read() |
69 | 73 |
|
70 | | -extensions += ['sphinx.ext.intersphinx', |
71 | | - 'sphinx_automodapi.smart_resolver', |
72 | | - 'sphinx.ext.autosectionlabel'] |
| 74 | +extensions += [ |
| 75 | + "sphinx.ext.intersphinx", |
| 76 | + "sphinx_automodapi.smart_resolver", |
| 77 | + "sphinx.ext.autosectionlabel", |
| 78 | +] |
73 | 79 |
|
74 | 80 | # For example, index:Introduction for a section called Introduction that |
75 | 81 | # appears in document index.rst. |
|
83 | 89 | # -- Project information ------------------------------------------------------ |
84 | 90 |
|
85 | 91 | # This does not *have* to match the package name, but typically does |
86 | | -project = setup_cfg['package_name'] |
87 | | -author = setup_cfg['author'] |
88 | | -copyright = '{0}, {1}'.format( |
89 | | - datetime.datetime.now().year, setup_cfg['author']) |
| 92 | +project = setup_cfg["package_name"] |
| 93 | +author = setup_cfg["author"] |
| 94 | +copyright = "{0}, {1}".format(datetime.datetime.now().year, setup_cfg["author"]) |
90 | 95 |
|
91 | 96 | # The version info for the project you're documenting, acts as replacement for |
92 | 97 | # |version| and |release|, also used in various other places throughout the |
93 | 98 | # built documents. |
94 | 99 |
|
95 | | -__import__(setup_cfg['package_name']) |
96 | | -package = sys.modules[setup_cfg['package_name']] |
| 100 | +__import__(setup_cfg["package_name"]) |
| 101 | +package = sys.modules[setup_cfg["package_name"]] |
97 | 102 |
|
98 | 103 | # The short X.Y version. |
99 | | -version = package.__version__.split('-', 1)[0] |
| 104 | +version = package.__version__.split("-", 1)[0] |
100 | 105 | # The full version, including alpha/beta/rc tags. |
101 | 106 | release = package.__version__ |
102 | 107 |
|
|
113 | 118 |
|
114 | 119 | # Add any paths that contain custom themes here, relative to this directory. |
115 | 120 | # To use a different custom theme, add the directory containing the theme. |
116 | | -#html_theme_path = [] |
| 121 | +# html_theme_path = [] |
117 | 122 |
|
118 | 123 | # The theme to use for HTML and HTML Help pages. See the documentation for |
119 | 124 | # a list of builtin themes. To override the custom theme, set this to the |
120 | 125 | # name of a builtin theme or the name of a custom theme in html_theme_path. |
121 | | -#html_theme = 'sphinx_rtd_theme' |
| 126 | +# html_theme = 'sphinx_rtd_theme' |
122 | 127 |
|
123 | 128 | # Please update these texts to match the name of your package. |
124 | 129 | html_theme_options = { |
125 | | - 'logotext1': 'sb', # white, semi-bold |
126 | | - 'logotext2': 'py', # orange, light |
127 | | - 'logotext3': ':docs' # white, light |
| 130 | + "logotext1": "sb", # white, semi-bold |
| 131 | + "logotext2": "py", # orange, light |
| 132 | + "logotext3": ":docs", # white, light |
128 | 133 | } |
129 | 134 |
|
130 | 135 |
|
131 | 136 | # Custom sidebar templates, maps document names to template names. |
132 | | -#html_sidebars = {} |
| 137 | +# html_sidebars = {} |
133 | 138 |
|
134 | 139 | # The name of an image file (relative to this directory) to place at the top |
135 | 140 | # of the sidebar. |
136 | | -#html_logo = '' |
| 141 | +# html_logo = '' |
137 | 142 |
|
138 | 143 | # The name of an image file (within the static path) to use as favicon of the |
139 | 144 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
140 | 145 | # pixels large. |
141 | | -#html_favicon = '' |
| 146 | +# html_favicon = '' |
142 | 147 |
|
143 | 148 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
144 | 149 | # using the given strftime format. |
145 | | -#html_last_updated_fmt = '' |
| 150 | +# html_last_updated_fmt = '' |
146 | 151 |
|
147 | 152 | # The name for this set of Sphinx documents. If None, it defaults to |
148 | 153 | # "<project> v<release> documentation". |
149 | | -html_title = '{0} v{1}'.format(project, release) |
| 154 | +html_title = "{0} v{1}".format(project, release) |
150 | 155 |
|
151 | 156 | # Output file base name for HTML help builder. |
152 | | -htmlhelp_basename = project + 'doc' |
| 157 | +htmlhelp_basename = project + "doc" |
153 | 158 |
|
154 | 159 |
|
155 | 160 | # -- Options for LaTeX output ------------------------------------------------- |
156 | 161 |
|
157 | 162 | # Grouping the document tree into LaTeX files. List of tuples |
158 | 163 | # (source start file, target name, title, author, documentclass [howto/manual]). |
159 | | -latex_documents = [('index', project + '.tex', project + u' Documentation', |
160 | | - author, 'manual')] |
| 164 | +latex_documents = [ |
| 165 | + ("index", project + ".tex", project + " Documentation", author, "manual") |
| 166 | +] |
161 | 167 |
|
162 | 168 |
|
163 | 169 | # -- Options for manual page output ------------------------------------------- |
164 | 170 |
|
165 | 171 | # One entry per manual page. List of tuples |
166 | 172 | # (source start file, name, description, authors, manual section). |
167 | | -man_pages = [('index', project.lower(), project + u' Documentation', |
168 | | - [author], 1)] |
| 173 | +man_pages = [("index", project.lower(), project + " Documentation", [author], 1)] |
169 | 174 |
|
170 | 175 |
|
171 | 176 | # -- Options for the edit_on_github extension --------------------------------- |
172 | 177 |
|
173 | | -if eval(setup_cfg.get('edit_on_github')): |
174 | | - extensions += ['sphinx_astropy.ext.edit_on_github'] |
| 178 | +if eval(setup_cfg.get("edit_on_github")): |
| 179 | + extensions += ["sphinx_astropy.ext.edit_on_github"] |
175 | 180 |
|
176 | | - versionmod = __import__(setup_cfg['package_name'] + '.version') |
177 | | - edit_on_github_project = setup_cfg['github_project'] |
| 181 | + versionmod = __import__(setup_cfg["package_name"] + ".version") |
| 182 | + edit_on_github_project = setup_cfg["github_project"] |
178 | 183 | if versionmod.version.release: |
179 | 184 | edit_on_github_branch = "v" + versionmod.version.version |
180 | 185 | else: |
|
184 | 189 | edit_on_github_doc_root = "docs" |
185 | 190 |
|
186 | 191 | # -- Resolving issue number to links in changelog ----------------------------- |
187 | | -github_issues_url = 'https://github.com/{0}/issues/'.format( |
188 | | - setup_cfg['github_project']) |
| 192 | +github_issues_url = "https://github.com/{0}/issues/".format(setup_cfg["github_project"]) |
189 | 193 |
|
190 | 194 | # -- compile list of field names |
191 | 195 | # import compile_fieldnames |
192 | 196 |
|
193 | 197 | # --- intersphinx setup |
194 | | -intersphinx_mapping['astroquery'] = ( |
195 | | - 'https://astroquery.readthedocs.io/en/stable/', None) |
| 198 | +intersphinx_mapping["astroquery"] = ( |
| 199 | + "https://astroquery.readthedocs.io/en/stable/", |
| 200 | + None, |
| 201 | +) |
196 | 202 |
|
197 | | -intersphinx_mapping['synphot'] = ( |
198 | | - 'https://synphot.readthedocs.io/en/stable/', None) |
| 203 | +intersphinx_mapping["synphot"] = ("https://synphot.readthedocs.io/en/stable/", None) |
199 | 204 |
|
200 | | -intersphinx_mapping['astropy'] = ( |
201 | | - 'https://docs.astropy.org/en/stable/', None) |
| 205 | +intersphinx_mapping["astropy"] = ("https://docs.astropy.org/en/stable/", None) |
0 commit comments