Fixed raising unnecessary deprecation warning

Closes #244
This commit is contained in:
Ashley Whetter 2020-10-26 16:22:26 -07:00
parent 78b79583af
commit e281137654
3 changed files with 10 additions and 3 deletions

View File

@ -26,6 +26,9 @@ Bug Fixes
^^^^^^^^^
* `#246 <https://github.com/readthedocs/sphinx-autoapi/issues/246>`:
Fixed TypeError when parsing a class that inherits from ``type``.
* `#244 <https://github.com/readthedocs/sphinx-autoapi/issues/244>`:
Fixed an unnecessary deprecation warning being raised when running
sphinx-build from the same directory as conf.py.
V1.5.1 (2020-10-01)

View File

@ -131,10 +131,10 @@ def run_autoapi(app): # pylint: disable=too-many-branches
sphinx_mapper = LANGUAGE_MAPPERS[app.config.autoapi_type]
template_dir = app.config.autoapi_template_dir
if template_dir:
if template_dir and not os.path.isabs(template_dir):
if not os.path.isdir(template_dir):
template_dir = os.path.join(app.confdir, app.config.autoapi_template_dir)
elif not os.path.isabs(template_dir):
elif app.confdir != os.getcwd():
warnings.warn(
"autoapi_template_dir will be expected to be "
" relative to conf.py instead of "

View File

@ -117,7 +117,11 @@ class Parser(object):
overloads = {}
for base in itertools.chain(iter((node,)), node.ancestors()):
seen = set()
if base.qname() in ("__builtins__.object", "builtins.object", "builtins.type"):
if base.qname() in (
"__builtins__.object",
"builtins.object",
"builtins.type",
):
continue
for child in base.get_children():
name = getattr(child, "name", None)