mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '3.4.x' into 3.x
This commit is contained in:
commit
d5d072bc3a
4
CHANGES
4
CHANGES
@ -98,6 +98,10 @@ Features added
|
||||
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
|
||||
--------
|
||||
|
||||
|
2
setup.py
2
setup.py
@ -44,7 +44,7 @@ extras_require = {
|
||||
'lint': [
|
||||
'flake8>=3.5.0',
|
||||
'isort',
|
||||
'mypy>=0.790',
|
||||
'mypy>=0.800',
|
||||
'docutils-stubs',
|
||||
],
|
||||
'test': [
|
||||
|
@ -94,7 +94,7 @@ class Stylesheet(str):
|
||||
|
||||
def __new__(cls, filename: str, *args: str, priority: int = 500, **attributes: Any
|
||||
) -> "Stylesheet":
|
||||
self = str.__new__(cls, filename) # type: ignore
|
||||
self = str.__new__(cls, filename)
|
||||
self.filename = filename
|
||||
self.priority = priority
|
||||
self.attributes = attributes
|
||||
@ -119,7 +119,7 @@ class JavaScript(str):
|
||||
priority = None # type: int
|
||||
|
||||
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.priority = priority
|
||||
self.attributes = attributes
|
||||
|
@ -137,8 +137,7 @@ class ASTIdentifier(ASTBaseBase):
|
||||
reftype='identifier',
|
||||
reftarget=targetText, modname=None,
|
||||
classname=None)
|
||||
key = symbol.get_lookup_key()
|
||||
pnode['c:parent_key'] = key
|
||||
pnode['c:parent_key'] = symbol.get_lookup_key()
|
||||
if self.is_anon():
|
||||
pnode += nodes.strong(text="[anonymous]")
|
||||
else:
|
||||
@ -3204,7 +3203,8 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
||||
def parse_pre_v3_type_definition(self, parser: DefinitionParser) -> ASTDeclaration:
|
||||
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)
|
||||
|
||||
def run(self) -> List[Node]:
|
||||
@ -3642,7 +3642,7 @@ class CExprRole(SphinxRole):
|
||||
location=self.get_source_info())
|
||||
# see below
|
||||
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:
|
||||
parentSymbol = self.env.domaindata['c']['root_symbol']
|
||||
# ...most if not all of these classes should really apply to the individual references,
|
||||
|
@ -34,7 +34,7 @@ if False:
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
LocaleFileInfoBase = namedtuple('CatalogInfo', 'base_dir,domain,charset')
|
||||
LocaleFileInfoBase = namedtuple('LocaleFileInfoBase', 'base_dir,domain,charset')
|
||||
|
||||
|
||||
class CatalogInfo(LocaleFileInfoBase):
|
||||
|
13
tests/roots/test-domain-c/ns_lookup.rst
Normal file
13
tests/roots/test-domain-c/ns_lookup.rst
Normal 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`
|
@ -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):
|
||||
domain = app.env.get_domain('c')
|
||||
for name, dispname, objectType, docname, anchor, prio in domain.get_objects():
|
||||
|
@ -18,10 +18,10 @@ for stable releases
|
||||
* ``python utils/bump_version.py --in-develop X.Y.Zb0`` (ex. 1.5.3b0)
|
||||
* Check diff by ``git diff``
|
||||
* ``git commit -am 'Bump version'``
|
||||
* ``git push origin X.Y --tags``
|
||||
* ``git checkout master``
|
||||
* ``git merge X.Y``
|
||||
* ``git push origin master``
|
||||
* ``git push origin X.Y.x --tags``
|
||||
* ``git checkout X.x``
|
||||
* ``git merge X.Y.x``
|
||||
* ``git push origin X.x``
|
||||
* Add new version/milestone to tracker categories
|
||||
* 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)
|
||||
* Check diff by ``git diff``
|
||||
* ``git commit -am 'Bump version'``
|
||||
* ``git checkout -b X.Y``
|
||||
* ``git push origin X.Y --tags``
|
||||
* ``git checkout -b X.x``
|
||||
* ``git push origin X.x --tags``
|
||||
* ``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)
|
||||
* Check diff by ``git diff``
|
||||
* ``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)
|
||||
* Check diff by `git diff``
|
||||
* ``git commit -am 'Bump version'``
|
||||
* ``git push origin X.Y --tags``
|
||||
* ``git push origin X.x --tags``
|
||||
* ``git checkout master``
|
||||
* ``git merge X.Y``
|
||||
* ``git merge X.x``
|
||||
* ``git push origin master``
|
||||
* Add new version/milestone to tracker categories
|
||||
* 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)
|
||||
* Check diff by ``git diff``
|
||||
* ``git commit -am 'Bump version'``
|
||||
* ``git push origin X.Y --tags``
|
||||
* ``git push origin X.x --tags``
|
||||
* ``git checkout master``
|
||||
* ``git merge X.Y``
|
||||
* ``git merge X.x``
|
||||
* ``git push origin master``
|
||||
* open https://github.com/sphinx-doc/sphinx/settings/branches and make ``A.B`` branch *not* protected
|
||||
* ``git checkout A.B`` (checkout old stable)
|
||||
|
Loading…
Reference in New Issue
Block a user