Skip to content

Commit 4181a80

Browse files
Cleanup cruft (#371)
1 parent c898c6c commit 4181a80

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

doc/conf.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from datetime import date
1616
import sys
1717
import os
18-
import re
1918

2019

2120
# If extensions (or modules to document with autodoc) are in another directory,
@@ -46,15 +45,9 @@
4645
'numpydoc',
4746
'sphinx.ext.ifconfig',
4847
'sphinx.ext.viewcode',
48+
'sphinx.ext.imgmath',
4949
]
5050

51-
try:
52-
import sphinx.ext.imgmath # noqa
53-
except ImportError:
54-
extensions.append('sphinx.ext.pngmath')
55-
else:
56-
extensions.append('sphinx.ext.imgmath')
57-
5851
# Add any paths that contain templates here, relative to this directory.
5952
templates_path = ['_templates']
6053

@@ -81,8 +74,7 @@
8174
# version = .__version__
8275
# The full version, including alpha/beta/rc tags.
8376
release = numpydoc.__version__
84-
version = re.sub(r'(\d+\.\d+)\.\d+(.*)', r'\1\2', numpydoc.__version__)
85-
version = re.sub(r'(\.dev\d+).*?$', r'\1', version)
77+
version = numpydoc.__version__
8678
numpydoc_xref_param_type = True
8779
numpydoc_xref_ignore = {'optional', 'type_without_description', 'BadException'}
8880
# Run docstring validation as part of build process

numpydoc/numpydoc.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,7 @@ def setup(app, get_doc_object_=get_doc_object):
244244
get_doc_object = get_doc_object_
245245

246246
app.setup_extension('sphinx.ext.autosummary')
247-
248-
# Once we bump our Sphinx requirement higher (1.7 or 1.8?)
249-
# we can just connect to config-inited
250-
try:
251-
app.connect('config-inited', update_config)
252-
except ExtensionError:
253-
app.connect('builder-inited', update_config)
254-
247+
app.connect('config-inited', update_config)
255248
app.connect('autodoc-process-docstring', mangle_docstrings)
256249
app.connect('autodoc-process-signature', mangle_signature)
257250
app.connect('doctree-read', relabel_references)

0 commit comments

Comments
 (0)