From f5aad1440f8143f003698670177fabfc5fa7bb9c Mon Sep 17 00:00:00 2001 From: sydneyli Date: Tue, 4 Dec 2018 10:56:15 -0800 Subject: [PATCH] Conditionally depend on imgconverter for newer versions of Sphinx (#6536) Fixes #6343. * conditionally depend on imgconverter * Pin docutils dependency for old Sphinx bug --- CHANGELOG.md | 1 + docs/conf.py | 8 ++++++-- setup.py | 5 +++-- tools/dev_constraints.txt | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03f93a881..6d9447ae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Certbot adheres to [Semantic Versioning](http://semver.org/). ### Fixed * Update code and dependencies to clean up Resource and Deprecation Warnings. +* Only depend on imgconverter extension for Sphinx >= 1.6 Despite us having broken lockstep, we are continuing to release new versions of all Certbot components during releases for the time being, however, the only diff --git a/docs/conf.py b/docs/conf.py index 2e6c5a9b7..c72d1c1cf 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,6 +17,8 @@ import os import re import sys +import sphinx + here = os.path.abspath(os.path.dirname(__file__)) @@ -33,14 +35,13 @@ sys.path.insert(0, os.path.abspath(os.path.join(here, '..'))) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.0' +needs_sphinx = '1.2' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', - 'sphinx.ext.imgconverter', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', @@ -48,6 +49,9 @@ extensions = [ 'repoze.sphinx.autointerface', ] +if sphinx.version_info >= (1, 6): + extensions.append('sphinx.ext.imgconverter') + autodoc_member_order = 'bysource' autodoc_default_flags = ['show-inheritance', 'private-members'] diff --git a/setup.py b/setup.py index 768501b82..382149054 100644 --- a/setup.py +++ b/setup.py @@ -68,9 +68,10 @@ dev3_extras = [ ] docs_extras = [ + # If you have Sphinx<1.5.1, you need docutils<0.13.1 + # https://github.com/sphinx-doc/sphinx/issues/3212 'repoze.sphinx.autointerface', - # sphinx.ext.imgconverter - 'Sphinx >=1.6', + 'Sphinx>=1.2', # Annotation support 'sphinx_rtd_theme', ] diff --git a/tools/dev_constraints.txt b/tools/dev_constraints.txt index 65182bcde..778012d31 100644 --- a/tools/dev_constraints.txt +++ b/tools/dev_constraints.txt @@ -14,7 +14,7 @@ coverage==4.4.2 decorator==4.1.2 dns-lexicon==2.7.14 dnspython==1.15.0 -docutils==0.14 +docutils==0.12 execnet==1.5.0 future==0.16.0 futures==3.1.1