← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:sphinx-deprecation into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:sphinx-deprecation into launchpad:master.

Commit message:
Use sphinx.cmd.build.main instead of sphinx.main

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/377210

This fixes a deprecation warning:

  RemovedInSphinx20Warning: `sphinx.main()` has moved to `sphinx.cmd.build.main()`.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:sphinx-deprecation into launchpad:master.
diff --git a/lib/lp/scripts/tests/test_sphinxdocs.py b/lib/lp/scripts/tests/test_sphinxdocs.py
index 194da50..30fb601 100644
--- a/lib/lp/scripts/tests/test_sphinxdocs.py
+++ b/lib/lp/scripts/tests/test_sphinxdocs.py
@@ -7,7 +7,7 @@ __metaclass__ = type
 
 import os
 
-import sphinx
+from sphinx.cmd.build import main as sphinx_main
 from testtools.content import text_content
 
 from lp.services.config import config
@@ -28,8 +28,8 @@ class TestSphinxDocumentation(TestCase):
         output_dir = self.makeTemporaryDirectory()
         doc_dir = os.path.join(config.root, 'doc')
         returncode, stdout, stderr = run_capturing_output(
-            sphinx.main,
-            ['sphinx-build', '-d', '%s/doctrees' % output_dir,
+            sphinx_main,
+            ['-d', '%s/doctrees' % output_dir,
              '-aNqW', doc_dir, '%s/html' % output_dir])
         self.addDetail('stdout', text_content(stdout))
         self.addDetail('stderr', text_content(stderr))