Skip to content

Commit 20f3dc0

Browse files
committed
some fixes for docrep==0.2.6
1 parent e18b4f1 commit 20f3dc0

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

docs/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
import re
1919
import six
2020
import funcargparse
21+
import warnings
2122

2223
# If extensions (or modules to document with autodoc) are in another directory,
2324
# add these directories to sys.path here. If the directory is relative to the
2425
# documentation root, use os.path.abspath to make it absolute, like shown here.
2526
sys.path.insert(0, os.path.abspath(osp.dirname(__file__)))
2627

28+
warnings.filterwarnings('ignore', 'To exit: use')
29+
2730
# -- General configuration ------------------------------------------------
2831

2932
# If your documentation needs a minimal Sphinx version, state it here.
@@ -389,7 +392,7 @@
389392

390393
# Example configuration for intersphinx: refer to the Python standard library.
391394
intersphinx_mapping = {
392-
'sphinx': ('http://sphinx-doc.org/', None),
395+
'sphinx': ('http://www.sphinx-doc.org/en/stable/', None),
393396
'docrep': ('http://docrep.readthedocs.org/en/latest', None),
394397
}
395398
if six.PY3:

funcargparse/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ def setup(func):
254254

255255
# create arguments
256256
args, varargs, varkw, defaults = inspect.getargspec(func)
257-
full_doc = docstrings.dedents(inspect.getdoc(func))
257+
doc = inspect.getdoc(func)
258+
full_doc = docstrings.dedents(doc) if doc else ''
258259

259260
summary = docstrings.get_full_description(full_doc)
260261
if summary:
@@ -384,8 +385,9 @@ def setup(func):
384385
name2use = name
385386
if name2use is None:
386387
name2use = func.__name__.replace('_', '-')
388+
doc = inspect.getdoc(func)
387389
kwargs.setdefault('help', docstrings.get_summary(
388-
docstrings.dedents(inspect.getdoc(func))))
390+
docstrings.dedents(doc) if doc else ''))
389391
parser = self._subparsers_action.add_parser(name2use, **kwargs)
390392
parser.setup_args(
391393
func, setup_as=setup_as, insert_at=insert_at,

0 commit comments

Comments
 (0)