From 57560c7abb0017823d36407b9fd3d0b2f5180ca8 Mon Sep 17 00:00:00 2001 From: Mahmoud Hashemi Date: Tue, 31 Mar 2015 00:45:28 -0700 Subject: [PATCH] napoleon/ReadTheDocs sphinx version fix --- docs/conf.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e549827..afdfa64 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,8 +12,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os +import sys +import sphinx # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -35,10 +36,13 @@ extensions = [ 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', - 'sphinx.ext.napoleon', ] -needs_sphinx = '1.3' +# Read the Docs is version 1.2 as of writing +if sphinx.version_info[:2] < (1, 3): + extensions.append('sphinxcontrib.napoleon') +else: + extensions.append('sphinx.ext.napoleon') # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']