File tree Expand file tree Collapse file tree 6 files changed +12
-32
lines changed Expand file tree Collapse file tree 6 files changed +12
-32
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ Changes in sphinx-astropy
4
4
1.7 (unreleased)
5
5
----------------
6
6
7
+ - Removed dependency on ``distutils ``. As a result, ``packaging `` is now
8
+ a dependency. [#51]
9
+
7
10
1.6 (2021-09-22)
8
11
----------------
9
12
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ zip_safe = False
19
19
packages = find:
20
20
python_requires = >=3.7
21
21
install_requires =
22
+ packaging
22
23
sphinx>=1.7
23
24
astropy-sphinx-theme
24
25
numpydoc
Original file line number Diff line number Diff line change 16
16
from os import path
17
17
18
18
import sphinx
19
- from distutils .version import LooseVersion
19
+ from packaging .version import Version
20
20
21
21
try :
22
22
import astropy
41
41
42
42
43
43
def check_sphinx_version (expected_version ):
44
- sphinx_version = LooseVersion (sphinx .__version__ )
45
- expected_version = LooseVersion (expected_version )
44
+ sphinx_version = Version (sphinx .__version__ )
45
+ expected_version = Version (expected_version )
46
46
if sphinx_version < expected_version :
47
47
raise RuntimeError (
48
48
"At least Sphinx version {0} is required to build this "
Original file line number Diff line number Diff line change 9
9
10
10
This is used e.g. by astropy-helpers when using the build_docs command.
11
11
"""
12
-
13
- from __future__ import print_function
14
-
15
- from distutils .version import LooseVersion
12
+ from packaging .version import Version
16
13
17
14
from sphinx import __version__
18
15
19
- SPHINX_LT_18 = LooseVersion (__version__ ) < LooseVersion ('1.8' )
16
+ SPHINX_LT_18 = Version (__version__ ) < Version ('1.8' )
20
17
21
18
22
19
def disable_intersphinx (app , config = None ):
Original file line number Diff line number Diff line change 4
4
The purpose of this extension is to give a clear warning if sphinx is expecting
5
5
a static directory to be present but it isn't.
6
6
"""
7
-
8
- from __future__ import print_function
9
-
10
7
import os
11
- from distutils .version import LooseVersion
8
+ from packaging .version import Version
12
9
13
10
from sphinx import __version__
14
11
15
- SPHINX_LT_18 = LooseVersion (__version__ ) < LooseVersion ('1.8' )
12
+ SPHINX_LT_18 = Version (__version__ ) < Version ('1.8' )
16
13
17
14
18
15
WARNING_TEMPLATE = """
Original file line number Diff line number Diff line change 1
- from distutils .version import LooseVersion
2
-
3
- from sphinx import __version__
4
-
5
- SPHINX_LT_17 = LooseVersion (__version__ ) < LooseVersion ('1.7' )
6
-
7
- if SPHINX_LT_17 :
8
-
9
- from sphinx import build_main as build_main_original
10
-
11
- # As of Sphinx 1.7, the first argument is now no longer ignored, so we
12
- # construct a wrapper for older versions.
13
-
14
- def build_main (argv = None ):
15
- argv .insert (0 , 'sphinx-build' )
16
- return build_main_original (argv = argv )
17
-
18
- else :
19
- from sphinx .cmd .build import build_main
1
+ from sphinx .cmd .build import build_main
20
2
21
3
BASIC_CONF = """
22
4
from sphinx_astropy.conf import *
You can’t perform that action at this time.
0 commit comments