Merge branch '3.4.x' into 3.x

This commit is contained in:
Takeshi KOMIYA 2021-01-22 21:40:27 +09:00
commit d5d072bc3a
8 changed files with 43 additions and 19 deletions

View File

@ -98,6 +98,10 @@ Features added
Bugs fixed Bugs fixed
---------- ----------
* #8655: autodoc: Failed to generate document if target module contains an
object that raises an exception on ``hasattr()``
* C, ``expr`` role should start symbol lookup in the current scope.
Testing Testing
-------- --------

View File

@ -44,7 +44,7 @@ extras_require = {
'lint': [ 'lint': [
'flake8>=3.5.0', 'flake8>=3.5.0',
'isort', 'isort',
'mypy>=0.790', 'mypy>=0.800',
'docutils-stubs', 'docutils-stubs',
], ],
'test': [ 'test': [

View File

@ -94,7 +94,7 @@ class Stylesheet(str):
def __new__(cls, filename: str, *args: str, priority: int = 500, **attributes: Any def __new__(cls, filename: str, *args: str, priority: int = 500, **attributes: Any
) -> "Stylesheet": ) -> "Stylesheet":
self = str.__new__(cls, filename) # type: ignore self = str.__new__(cls, filename)
self.filename = filename self.filename = filename
self.priority = priority self.priority = priority
self.attributes = attributes self.attributes = attributes
@ -119,7 +119,7 @@ class JavaScript(str):
priority = None # type: int priority = None # type: int
def __new__(cls, filename: str, priority: int = 500, **attributes: str) -> "JavaScript": def __new__(cls, filename: str, priority: int = 500, **attributes: str) -> "JavaScript":
self = str.__new__(cls, filename) # type: ignore self = str.__new__(cls, filename)
self.filename = filename self.filename = filename
self.priority = priority self.priority = priority
self.attributes = attributes self.attributes = attributes

View File

@ -137,8 +137,7 @@ class ASTIdentifier(ASTBaseBase):
reftype='identifier', reftype='identifier',
reftarget=targetText, modname=None, reftarget=targetText, modname=None,
classname=None) classname=None)
key = symbol.get_lookup_key() pnode['c:parent_key'] = symbol.get_lookup_key()
pnode['c:parent_key'] = key
if self.is_anon(): if self.is_anon():
pnode += nodes.strong(text="[anonymous]") pnode += nodes.strong(text="[anonymous]")
else: else:
@ -3204,7 +3203,8 @@ class CObject(ObjectDescription[ASTDeclaration]):
def parse_pre_v3_type_definition(self, parser: DefinitionParser) -> ASTDeclaration: def parse_pre_v3_type_definition(self, parser: DefinitionParser) -> ASTDeclaration:
return parser.parse_pre_v3_type_definition() return parser.parse_pre_v3_type_definition()
def describe_signature(self, signode: TextElement, ast: Any, options: Dict) -> None: def describe_signature(self, signode: TextElement, ast: ASTDeclaration,
options: Dict) -> None:
ast.describe_signature(signode, 'lastIsName', self.env, options) ast.describe_signature(signode, 'lastIsName', self.env, options)
def run(self) -> List[Node]: def run(self) -> List[Node]:
@ -3642,7 +3642,7 @@ class CExprRole(SphinxRole):
location=self.get_source_info()) location=self.get_source_info())
# see below # see below
return [self.node_type(text, text, classes=classes)], [] return [self.node_type(text, text, classes=classes)], []
parentSymbol = self.env.temp_data.get('cpp:parent_symbol', None) parentSymbol = self.env.temp_data.get('c:parent_symbol', None)
if parentSymbol is None: if parentSymbol is None:
parentSymbol = self.env.domaindata['c']['root_symbol'] parentSymbol = self.env.domaindata['c']['root_symbol']
# ...most if not all of these classes should really apply to the individual references, # ...most if not all of these classes should really apply to the individual references,

View File

@ -34,7 +34,7 @@ if False:
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
LocaleFileInfoBase = namedtuple('CatalogInfo', 'base_dir,domain,charset') LocaleFileInfoBase = namedtuple('LocaleFileInfoBase', 'base_dir,domain,charset')
class CatalogInfo(LocaleFileInfoBase): class CatalogInfo(LocaleFileInfoBase):

View File

@ -0,0 +1,13 @@
.. c:namespace:: ns_lookup
.. c:var:: int i
.. c:function:: void f(int j)
- :c:var:`i`
- :c:var:`j`
- :c:expr:`i`
- :c:expr:`j`
- :c:var:`i`
- :c:expr:`i`

View File

@ -598,6 +598,13 @@ def test_build_function_param_target(app, warning):
] ]
@pytest.mark.sphinx(testroot='domain-c', confoverrides={'nitpicky': True})
def test_build_ns_lookup(app, warning):
app.builder.build_all()
ws = filter_warnings(warning, "ns_lookup")
assert len(ws) == 0
def _get_obj(app, queryName): def _get_obj(app, queryName):
domain = app.env.get_domain('c') domain = app.env.get_domain('c')
for name, dispname, objectType, docname, anchor, prio in domain.get_objects(): for name, dispname, objectType, docname, anchor, prio in domain.get_objects():

View File

@ -18,10 +18,10 @@ for stable releases
* ``python utils/bump_version.py --in-develop X.Y.Zb0`` (ex. 1.5.3b0) * ``python utils/bump_version.py --in-develop X.Y.Zb0`` (ex. 1.5.3b0)
* Check diff by ``git diff`` * Check diff by ``git diff``
* ``git commit -am 'Bump version'`` * ``git commit -am 'Bump version'``
* ``git push origin X.Y --tags`` * ``git push origin X.Y.x --tags``
* ``git checkout master`` * ``git checkout X.x``
* ``git merge X.Y`` * ``git merge X.Y.x``
* ``git push origin master`` * ``git push origin X.x``
* Add new version/milestone to tracker categories * Add new version/milestone to tracker categories
* Write announcement and send to sphinx-dev, sphinx-users and python-announce * Write announcement and send to sphinx-dev, sphinx-users and python-announce
@ -43,10 +43,10 @@ for first beta releases
* ``python utils/bump_version.py --in-develop X.Y.0b2`` (ex. 1.6.0b2) * ``python utils/bump_version.py --in-develop X.Y.0b2`` (ex. 1.6.0b2)
* Check diff by ``git diff`` * Check diff by ``git diff``
* ``git commit -am 'Bump version'`` * ``git commit -am 'Bump version'``
* ``git checkout -b X.Y`` * ``git checkout -b X.x``
* ``git push origin X.Y --tags`` * ``git push origin X.x --tags``
* ``git checkout master`` * ``git checkout master``
* ``git merge X.Y`` * ``git merge X.x``
* ``python utils/bump_version.py --in-develop A.B.0b0`` (ex. 1.7.0b0) * ``python utils/bump_version.py --in-develop A.B.0b0`` (ex. 1.7.0b0)
* Check diff by ``git diff`` * Check diff by ``git diff``
* ``git commit -am 'Bump version'`` * ``git commit -am 'Bump version'``
@ -71,9 +71,9 @@ for other beta releases
* ``python utils/bump_version.py --in-develop X.Y.0bM`` (ex. 1.6.0b3) * ``python utils/bump_version.py --in-develop X.Y.0bM`` (ex. 1.6.0b3)
* Check diff by `git diff`` * Check diff by `git diff``
* ``git commit -am 'Bump version'`` * ``git commit -am 'Bump version'``
* ``git push origin X.Y --tags`` * ``git push origin X.x --tags``
* ``git checkout master`` * ``git checkout master``
* ``git merge X.Y`` * ``git merge X.x``
* ``git push origin master`` * ``git push origin master``
* Add new version/milestone to tracker categories * Add new version/milestone to tracker categories
* Write announcement and send to sphinx-dev, sphinx-users and python-announce * Write announcement and send to sphinx-dev, sphinx-users and python-announce
@ -99,9 +99,9 @@ for major releases
* ``python utils/bump_version.py --in-develop X.Y.1b0`` (ex. 1.6.1b0) * ``python utils/bump_version.py --in-develop X.Y.1b0`` (ex. 1.6.1b0)
* Check diff by ``git diff`` * Check diff by ``git diff``
* ``git commit -am 'Bump version'`` * ``git commit -am 'Bump version'``
* ``git push origin X.Y --tags`` * ``git push origin X.x --tags``
* ``git checkout master`` * ``git checkout master``
* ``git merge X.Y`` * ``git merge X.x``
* ``git push origin master`` * ``git push origin master``
* open https://github.com/sphinx-doc/sphinx/settings/branches and make ``A.B`` branch *not* protected * open https://github.com/sphinx-doc/sphinx/settings/branches and make ``A.B`` branch *not* protected
* ``git checkout A.B`` (checkout old stable) * ``git checkout A.B`` (checkout old stable)