mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '3.x'
This commit is contained in:
commit
f9ca909ea0
16
CHANGES
16
CHANGES
@ -79,7 +79,7 @@ Bugs fixed
|
|||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
Release 3.5.1 (in development)
|
Release 3.5.2 (in development)
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
@ -100,6 +100,20 @@ Bugs fixed
|
|||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
Release 3.5.1 (released Feb 16, 2021)
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
Bugs fixed
|
||||||
|
----------
|
||||||
|
|
||||||
|
* #8883: autodoc: AttributeError is raised on assigning __annotations__ on
|
||||||
|
read-only class
|
||||||
|
* #8884: html: minified js stemmers not included in the distributed package
|
||||||
|
* #8885: html: AttributeError is raised if CSS/JS files are installed via
|
||||||
|
:confval:`html_context`
|
||||||
|
* #8880: viewcode: ExtensionError is raised on incremental build after
|
||||||
|
unparsable python module found
|
||||||
|
|
||||||
Release 3.5.0 (released Feb 14, 2021)
|
Release 3.5.0 (released Feb 14, 2021)
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ recursive-include sphinx/texinputs_win *
|
|||||||
recursive-include sphinx/themes *
|
recursive-include sphinx/themes *
|
||||||
recursive-include sphinx/locale *.js *.pot *.po *.mo
|
recursive-include sphinx/locale *.js *.pot *.po *.mo
|
||||||
recursive-include sphinx/search/non-minified-js *.js
|
recursive-include sphinx/search/non-minified-js *.js
|
||||||
|
recursive-include sphinx/search/minified-js *.js
|
||||||
recursive-include sphinx/ext/autosummary/templates *
|
recursive-include sphinx/ext/autosummary/templates *
|
||||||
recursive-include tests *
|
recursive-include tests *
|
||||||
recursive-include utils *
|
recursive-include utils *
|
||||||
|
@ -1035,8 +1035,20 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
templatename = newtmpl
|
templatename = newtmpl
|
||||||
|
|
||||||
# sort JS/CSS before rendering HTML
|
# sort JS/CSS before rendering HTML
|
||||||
ctx['script_files'].sort(key=lambda js: js.priority)
|
try:
|
||||||
ctx['css_files'].sort(key=lambda js: js.priority)
|
# Convert script_files to list to support non-list script_files (refs: #8889)
|
||||||
|
ctx['script_files'] = sorted(list(ctx['script_files']), key=lambda js: js.priority)
|
||||||
|
except AttributeError:
|
||||||
|
# Skip sorting if users modifies script_files directly (maybe via `html_context`).
|
||||||
|
# refs: #8885
|
||||||
|
#
|
||||||
|
# Note: priority sorting feature will not work in this case.
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
ctx['css_files'] = sorted(list(ctx['css_files']), key=lambda css: css.priority)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
output = self.templates.render(templatename, ctx)
|
output = self.templates.render(templatename, ctx)
|
||||||
|
@ -1377,7 +1377,7 @@ class FunctionDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter): # typ
|
|||||||
params[0] = params[0].replace(annotation=typ)
|
params[0] = params[0].replace(annotation=typ)
|
||||||
try:
|
try:
|
||||||
func.__signature__ = sig.replace(parameters=params) # type: ignore
|
func.__signature__ = sig.replace(parameters=params) # type: ignore
|
||||||
except TypeError:
|
except (AttributeError, TypeError):
|
||||||
# failed to update signature (ex. built-in or extension types)
|
# failed to update signature (ex. built-in or extension types)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -2156,7 +2156,7 @@ class MethodDocumenter(DocstringSignatureMixin, ClassLevelDocumenter): # type:
|
|||||||
params[1] = params[1].replace(annotation=typ)
|
params[1] = params[1].replace(annotation=typ)
|
||||||
try:
|
try:
|
||||||
func.__signature__ = sig.replace(parameters=params) # type: ignore
|
func.__signature__ = sig.replace(parameters=params) # type: ignore
|
||||||
except TypeError:
|
except (AttributeError, TypeError):
|
||||||
# failed to update signature (ex. built-in or extension types)
|
# failed to update signature (ex. built-in or extension types)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -2422,7 +2422,7 @@ class AttributeDocumenter(GenericAliasMixin, NewTypeMixin, SlotsMixin, # type:
|
|||||||
annotations[attrname] = annotation
|
annotations[attrname] = annotation
|
||||||
except (AttributeError, PycodeError):
|
except (AttributeError, PycodeError):
|
||||||
pass
|
pass
|
||||||
except TypeError:
|
except (AttributeError, TypeError):
|
||||||
# Failed to set __annotations__ (built-in, extensions, etc.)
|
# Failed to set __annotations__ (built-in, extensions, etc.)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -152,7 +152,11 @@ def env_merge_info(app: Sphinx, env: BuildEnvironment, docnames: Iterable[str],
|
|||||||
def env_purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None:
|
def env_purge_doc(app: Sphinx, env: BuildEnvironment, docname: str) -> None:
|
||||||
modules = getattr(env, '_viewcode_modules', {})
|
modules = getattr(env, '_viewcode_modules', {})
|
||||||
|
|
||||||
for modname, (code, tags, used, refname) in list(modules.items()):
|
for modname, entry in list(modules.items()):
|
||||||
|
if entry is False:
|
||||||
|
continue
|
||||||
|
|
||||||
|
code, tags, used, refname = entry
|
||||||
for fullname in list(used):
|
for fullname in list(used):
|
||||||
if used[fullname] == docname:
|
if used[fullname] == docname:
|
||||||
used.pop(fullname)
|
used.pop(fullname)
|
||||||
|
@ -1597,6 +1597,13 @@ def test_html_codeblock_linenos_style_table(app):
|
|||||||
app.build()
|
app.build()
|
||||||
content = (app.outdir / 'index.html').read_text()
|
content = (app.outdir / 'index.html').read_text()
|
||||||
|
|
||||||
|
pygments_version = tuple(LooseVersion(pygments.__version__).version)
|
||||||
|
if pygments_version >= (2, 8):
|
||||||
|
assert ('<div class="linenodiv"><pre><span class="normal">1</span>\n'
|
||||||
|
'<span class="normal">2</span>\n'
|
||||||
|
'<span class="normal">3</span>\n'
|
||||||
|
'<span class="normal">4</span></pre></div>') in content
|
||||||
|
else:
|
||||||
assert '<div class="linenodiv"><pre>1\n2\n3\n4</pre></div>' in content
|
assert '<div class="linenodiv"><pre>1\n2\n3\n4</pre></div>' in content
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user