Merge pull request #4624 from tk0miya/4623_sphinx.build_main

Fix #4623: sphinx.build_main no longer exists in 1.7.0
This commit is contained in:
Takeshi KOMIYA 2018-02-18 17:31:12 +09:00 committed by GitHub
commit c8dbf60226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View File

@ -10,6 +10,9 @@ Incompatible changes
Deprecated
----------
* #4623: ``sphinx.build_main()`` is deprecated. Use
``sphinx.cmd.build.build_main()`` instead.
Features added
--------------
@ -22,6 +25,8 @@ Bugs fixed
* #4622: epub: :confval:`epub_scheme` does not effect to content.opf
* #4627: graphviz: Fit graphviz images to page
* #4617: quickstart: PROJECT_DIR argument is required
* #4623: sphinx.build_main no longer exists in 1.7.0
* #4615: The argument of ``sphinx.build`` has been changed in 1.7.0
Testing
--------

View File

@ -15,6 +15,7 @@
from __future__ import absolute_import
import os
import sys
import warnings
from os import path
@ -66,9 +67,30 @@ def main(*args, **kwargs):
RemovedInSphinx20Warning,
stacklevel=2,
)
args = args[1:] # skip first argument to adjust arguments (refs: #4615)
return build.main(*args, **kwargs)
def build_main(argv=sys.argv):
"""Sphinx build "main" command-line entry."""
warnings.warn(
'`sphinx.build_main()` has moved to `sphinx.cmd.build.build_main()`.',
RemovedInSphinx20Warning,
stacklevel=2,
)
return build.build_main(argv[1:]) # skip first argument to adjust arguments (refs: #4615)
def make_main(argv=sys.argv):
"""Sphinx build "make mode" entry."""
warnings.warn(
'`sphinx.build_main()` has moved to `sphinx.cmd.build.make_main()`.',
RemovedInSphinx20Warning,
stacklevel=2,
)
return build.make_main(argv[1:]) # skip first argument to adjust arguments (refs: #4615)
if __name__ == '__main__':
from .cmd import build
warnings.warn(

View File

@ -21,6 +21,7 @@ def main(*args, **kwargs):
RemovedInSphinx20Warning,
stacklevel=2,
)
args = args[1:] # skip first argument to adjust arguments (refs: #4615)
_main(*args, **kwargs)

View File

@ -22,6 +22,7 @@ def main(*args, **kwargs):
RemovedInSphinx20Warning,
stacklevel=2,
)
args = args[1:] # skip first argument to adjust arguments (refs: #4615)
_main(*args, **kwargs)