Skip to content

Commit 83bf83e

Browse files
committed
Require Sphinx 3.0
1 parent 9e65eda commit 83bf83e

File tree

6 files changed

+9
-34
lines changed

6 files changed

+9
-34
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ packages = find:
2020
python_requires = >=3.7
2121
install_requires =
2222
packaging
23-
sphinx>=1.7
23+
sphinx>=3.0.0
2424
astropy-sphinx-theme
2525
numpydoc
2626
sphinx-automodapi

sphinx_astropy/conf/v1.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from os import path
1717

18+
import astropy_sphinx_theme
1819
import sphinx
1920
from packaging.version import Version
2021

@@ -34,7 +35,7 @@
3435
# minor parts of the version number, not the micro. To do a more
3536
# specific version check, call check_sphinx_version("x.y.z.") from
3637
# your project's conf.py
37-
needs_sphinx = '1.7'
38+
needs_sphinx = '3.0'
3839

3940

4041
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
@@ -64,7 +65,8 @@ def check_sphinx_version(expected_version):
6465
'matplotlib': ('https://matplotlib.org/stable/',
6566
(None, 'http://data.astropy.org/intersphinx/matplotlib.inv')),
6667
'astropy': ('https://docs.astropy.org/en/stable/', None),
67-
'h5py': ('https://docs.h5py.org/en/stable/', None)}
68+
'h5py': ('https://docs.h5py.org/en/stable/', None),
69+
}
6870

6971
# List of patterns, relative to source directory, that match files and
7072
# directories to ignore when looking for source files.
@@ -270,7 +272,6 @@ def check_sphinx_version(expected_version):
270272
# pixels large.
271273

272274
# We include by default the favicon that is in the bootstrap-astropy theme.
273-
import astropy_sphinx_theme
274275
html_theme_path = astropy_sphinx_theme.get_html_theme_path()
275276
html_favicon = os.path.join(html_theme_path[0], html_theme, 'static', 'astropy_logo.ico')
276277

sphinx_astropy/ext/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from __future__ import division, absolute_import, print_function
21

sphinx_astropy/ext/changelog_links.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
GitHub issues.
55
"""
66

7-
from __future__ import print_function
8-
97
import re
108
from docutils.nodes import Text, reference
119

sphinx_astropy/ext/intersphinx_toggle.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,12 @@
99
1010
This is used e.g. by astropy-helpers when using the build_docs command.
1111
"""
12-
from packaging.version import Version
1312

14-
from sphinx import __version__
15-
16-
SPHINX_LT_18 = Version(__version__) < Version('1.8')
13+
from sphinx.util.console import bold
14+
from sphinx.util import logging
1715

1816

1917
def disable_intersphinx(app, config=None):
20-
21-
from sphinx.util.console import bold
22-
23-
from sphinx.util import logging
2418
info = logging.getLogger(__name__).info
2519

2620
if app.config.disable_intersphinx:
@@ -29,16 +23,7 @@ def disable_intersphinx(app, config=None):
2923

3024

3125
def setup(app):
32-
33-
# Note that the config-inited setting was only added in Sphinx 1.8. For
34-
# earlier versions we use builder-inited but we need to be careful in what
35-
# order the extensions are declared so that this happens before intersphinx.
36-
if SPHINX_LT_18:
37-
app.connect('builder-inited', disable_intersphinx)
38-
else:
39-
app.connect('config-inited', disable_intersphinx)
40-
26+
app.connect('config-inited', disable_intersphinx)
4127
app.add_config_value('disable_intersphinx', 0, True)
42-
4328
return {'parallel_read_safe': True,
4429
'parallel_write_safe': True}

sphinx_astropy/ext/missing_static.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
a static directory to be present but it isn't.
66
"""
77
import os
8-
from packaging.version import Version
9-
10-
from sphinx import __version__
11-
12-
SPHINX_LT_18 = Version(__version__) < Version('1.8')
13-
8+
from sphinx.util import logging
149

1510
WARNING_TEMPLATE = """
1611
Note: The static directory '{0}' was not found. This is often because it is
@@ -22,8 +17,6 @@
2217

2318

2419
def static_warning(app, config=None):
25-
26-
from sphinx.util import logging
2720
info = logging.getLogger(__name__).info
2821

2922
for directory in app.config.html_static_path:
@@ -32,7 +25,6 @@ def static_warning(app, config=None):
3225

3326

3427
def setup(app):
35-
3628
app.connect('build-finished', static_warning)
3729

3830
return {'parallel_read_safe': True,

0 commit comments

Comments
 (0)