mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-24 22:27:52 -05:00
Fix #6703: autodoc: incremental build does not work for imported objects
This commit is contained in:
1 parent
56ed2991fd
commit
421a544aab
2 files changed
+12
-1
No files matched your search
@@ -62,6 +62,8 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #6703: autodoc: incremental build does not work for imported objects
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
||||
@@ -732,7 +732,8 @@ class Documenter:
|
||||
# where the attribute documentation would actually be found in.
|
||||
# This is used for situations where you have a module that collects the
|
||||
# functions and classes of internal submodules.
|
||||
self.real_modname = real_modname or self.get_real_modname() # type: str
|
||||
guess_modname = self.get_real_modname()
|
||||
self.real_modname = real_modname or guess_modname
|
||||
|
||||
# try to also get a source code analyzer for attribute docs
|
||||
try:
|
||||
@@ -750,6 +751,14 @@ class Documenter:
|
||||
else:
|
||||
self.directive.filename_set.add(self.analyzer.srcname)
|
||||
|
||||
if self.real_modname != guess_modname:
|
||||
# Add module to dependency list if target object is defined in other module.
|
||||
try:
|
||||
analyzer = ModuleAnalyzer.for_module(guess_modname)
|
||||
self.directive.filename_set.add(analyzer.srcname)
|
||||
except PycodeError:
|
||||
pass
|
||||
|
||||
# check __module__ of object (for members not given explicitly)
|
||||
if check_module:
|
||||
if not self.check_module():
|
||||
|
||||
Reference in new issue
Block a user