Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt to import handle napoleon from sphinx #16

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion defopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
from xml.etree import ElementTree

from docutils.core import publish_doctree
from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring
try:
from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring
except ImportError: # pragma: no cover
from sphinxcontrib.napoleon.docstring import GoogleDocstring
from sphinxcontrib.napoleon.docstring import NumpyDocstring

# The 2.x builtin goes first so we don't get future's builtins if installed
try:
Expand Down
1 change: 1 addition & 0 deletions docs/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ A runnable example is available at `examples/annotations.py`_.
.. [#] While Napoleon is included with Sphinx as `sphinx.ext.napoleon`, defopt
depends on ``sphinxcontrib-napoleon`` so that end users of your command line
tool are not required to install Sphinx and all of its dependencies.
However, if Sphinx is installed, defopt can just use that.
.. [#] `enum` was introduced in Python 3.4. If you are using an older version
of Python, the backport will be installed as a dependency.
.. [#] `typing` was introduced in Python 3.5. If you are using an older version
Expand Down