Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-03-20 18:52:49 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-03-20 18:52:53 +0300
commitcb654d287b0296a5acc539f962c7ef1ecc4a523f (patch)
treecfc715d43e38c65e8486040df23ad7a5cce2b07e /sphinx/ext
parent5e8f814e81ef11da9efc48f4efd6647c5bfa4596 (diff)
Rename DocumenterBridge.filename_set to record_dependencies
DocumenterBridge.filename_set has been used since its beginning. On the other hand, in docutils, record_dependencies attribute is well-used to store the list of dependency files. So this renames it to docutils' standard attribute.
Diffstat (limited to 'sphinx/ext')
-rw-r--r--sphinx/ext/autodoc/__init__.py6
-rw-r--r--sphinx/ext/autodoc/directive.py12
2 files changed, 12 insertions, 6 deletions
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
index fe6b483d4..a01402090 100644
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -918,15 +918,15 @@ class Documenter:
self.analyzer = None
# at least add the module.__file__ as a dependency
if hasattr(self.module, '__file__') and self.module.__file__:
- self.directive.filename_set.add(self.module.__file__)
+ self.directive.record_dependencies.add(self.module.__file__)
else:
- self.directive.filename_set.add(self.analyzer.srcname)
+ self.directive.record_dependencies.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)
+ self.directive.record_dependencies.add(analyzer.srcname)
except PycodeError:
pass
diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py
index 78e17b867..a6608698d 100644
--- a/sphinx/ext/autodoc/directive.py
+++ b/sphinx/ext/autodoc/directive.py
@@ -16,7 +16,7 @@ from docutils.statemachine import StringList
from docutils.utils import Reporter, assemble_option_dict
from sphinx.config import Config
-from sphinx.deprecation import RemovedInSphinx50Warning
+from sphinx.deprecation import RemovedInSphinx50Warning, RemovedInSphinx60Warning
from sphinx.environment import BuildEnvironment
from sphinx.ext.autodoc import Documenter, Options
from sphinx.util import logging
@@ -56,7 +56,7 @@ class DocumenterBridge:
self._reporter = reporter
self.genopt = options
self.lineno = lineno
- self.filename_set: Set[str] = set()
+ self.record_dependencies: Set[str] = set()
self.result = StringList()
self.state = state
@@ -64,6 +64,12 @@ class DocumenterBridge:
logger.warning(msg, location=(self.env.docname, self.lineno))
@property
+ def filename_set(self) -> Set:
+ warnings.warn('DocumenterBridge.filename_set is deprecated.',
+ RemovedInSphinx60Warning, stacklevel=2)
+ return self.record_dependencies
+
+ @property
def reporter(self) -> Reporter:
warnings.warn('DocumenterBridge.reporter is deprecated.',
RemovedInSphinx50Warning, stacklevel=2)
@@ -158,7 +164,7 @@ class AutodocDirective(SphinxDirective):
# record all filenames as dependencies -- this will at least
# partially make automatic invalidation possible
- for fn in params.filename_set:
+ for fn in params.record_dependencies:
self.state.document.settings.record_dependencies.add(fn)
result = parse_generated_content(self.state, params.result, documenter)