Skip to content

Commit

Permalink
Merge branch '4.0.x' into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed May 10, 2021
2 parents a02d244 + d627a5f commit 71e7320
Show file tree
Hide file tree
Showing 120 changed files with 229 additions and 175 deletions.
18 changes: 17 additions & 1 deletion CHANGES
Expand Up @@ -45,7 +45,7 @@ Bugs fixed
Testing
--------

Release 4.0.1 (in development)
Release 4.0.2 (in development)
==============================

Dependencies
Expand All @@ -66,6 +66,22 @@ Bugs fixed
Testing
--------

Release 4.0.1 (released May 11, 2021)
=====================================

Bugs fixed
----------

* #9189: autodoc: crashed when ValueError is raised on generating signature
from a property of the class
* #9188: autosummary: warning is emitted if list value is set to
autosummary_generate
* #8380: html search: tags for search result are broken
* #9198: i18n: Babel emits errors when running compile_catalog
* #9205: py domain: The :canonical: option causes "more than one target for
cross-reference" warning
* #9201: websupport: UndefinedError is raised: 'css_tag' is undefined

Release 4.0.0 (released May 09, 2021)
=====================================

Expand Down
31 changes: 21 additions & 10 deletions sphinx/builders/html/__init__.py
Expand Up @@ -1000,16 +1000,6 @@ def pathto(otheruri: str, resource: bool = False, baseuri: str = default_baseuri
return uri
ctx['pathto'] = pathto

def css_tag(css: Stylesheet) -> str:
attrs = []
for key in sorted(css.attributes):
value = css.attributes[key]
if value is not None:
attrs.append('%s="%s"' % (key, html.escape(value, True)))
attrs.append('href="%s"' % pathto(css.filename, resource=True))
return '<link %s />' % ' '.join(attrs)
ctx['css_tag'] = css_tag

def hasdoc(name: str) -> bool:
if name in self.env.all_docs:
return True
Expand Down Expand Up @@ -1140,6 +1130,26 @@ def convert_html_js_files(app: Sphinx, config: Config) -> None:
config.html_js_files = html_js_files # type: ignore


def setup_css_tag_helper(app: Sphinx, pagename: str, templatename: str,
context: Dict, doctree: Node) -> None:
"""Set up css_tag() template helper.
.. note:: This set up function is added to keep compatibility with webhelper.
"""
pathto = context.get('pathto')

def css_tag(css: Stylesheet) -> str:
attrs = []
for key in sorted(css.attributes):
value = css.attributes[key]
if value is not None:
attrs.append('%s="%s"' % (key, html.escape(value, True)))
attrs.append('href="%s"' % pathto(css.filename, resource=True))
return '<link %s />' % ' '.join(attrs)

context['css_tag'] = css_tag


def setup_js_tag_helper(app: Sphinx, pagename: str, templatename: str,
context: Dict, doctree: Node) -> None:
"""Set up js_tag() template helper.
Expand Down Expand Up @@ -1347,6 +1357,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.connect('config-inited', validate_html_logo, priority=800)
app.connect('config-inited', validate_html_favicon, priority=800)
app.connect('builder-inited', validate_math_renderer)
app.connect('html-page-context', setup_css_tag_helper)
app.connect('html-page-context', setup_js_tag_helper)
app.connect('html-page-context', setup_resource_paths)

Expand Down
10 changes: 7 additions & 3 deletions sphinx/domains/python.py
Expand Up @@ -1269,9 +1269,13 @@ def resolve_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder
if not matches:
return None
elif len(matches) > 1:
logger.warning(__('more than one target found for cross-reference %r: %s'),
target, ', '.join(match[0] for match in matches),
type='ref', subtype='python', location=node)
canonicals = [m for m in matches if not m[1].aliased]
if len(canonicals) == 1:
matches = canonicals
else:
logger.warning(__('more than one target found for cross-reference %r: %s'),
target, ', '.join(match[0] for match in matches),
type='ref', subtype='python', location=node)
name, obj = matches[0]

if obj[2] == 'module':
Expand Down
2 changes: 1 addition & 1 deletion sphinx/ext/autodoc/__init__.py
Expand Up @@ -2592,7 +2592,7 @@ def add_directive_header(self, sig: str) -> None:
self.fullname, exc)
return None
except ValueError:
raise
return None


class NewTypeAttributeDocumenter(AttributeDocumenter):
Expand Down
2 changes: 1 addition & 1 deletion sphinx/ext/autosummary/__init__.py
Expand Up @@ -775,7 +775,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.connect('builder-inited', process_generate_options)
app.add_config_value('autosummary_context', {}, True)
app.add_config_value('autosummary_filename_map', {}, 'html')
app.add_config_value('autosummary_generate', True, True, [bool])
app.add_config_value('autosummary_generate', True, True, [bool, list])
app.add_config_value('autosummary_generate_overwrite', True, False)
app.add_config_value('autosummary_mock_imports',
lambda config: config.autodoc_mock_imports, 'env')
Expand Down
32 changes: 16 additions & 16 deletions sphinx/locale/ar/LC_MESSAGES/sphinx.js
Expand Up @@ -11,12 +11,12 @@ Documentation.addTranslations({
"Changes in Version %(version)s &#8212; %(docstitle)s": "",
"Collapse sidebar": "",
"Complete Table of Contents": "",
"Contents": "",
"Copyright": "",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Contents": "\u0627\u0644\u0645\u062d\u062a\u0648\u0649",
"Copyright": "\u0627\u0644\u062d\u0642\u0648\u0642",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "",
"Full index on one page": "",
"General Index": "",
"General Index": "\u0627\u0644\u0641\u0647\u0631\u0633 \u0627\u0644\u0639\u0627\u0645",
"Global Module Index": "",
"Go": "",
"Hide Search Matches": "",
Expand All @@ -25,7 +25,7 @@ Documentation.addTranslations({
"Index pages by letter": "",
"Indices and tables:": "",
"Last updated on %(last_updated)s.": "",
"Library changes": "",
"Library changes": "\u062a\u062c\u0647\u064a\u0632 \u0627\u0644\u0628\u062d\u062b",
"Navigation": "",
"Next topic": "\u0627\u0644\u0645\u0648\u0636\u0648\u0639 \u0627\u0644\u062a\u0627\u0644\u064a",
"Other changes": "",
Expand All @@ -35,29 +35,29 @@ Documentation.addTranslations({
"Please activate JavaScript to enable the search\n functionality.": "",
"Preparing search...": "",
"Previous topic": "\u0627\u0644\u0645\u0648\u0636\u0648\u0639 \u0627\u0644\u0633\u0627\u0628\u0642",
"Quick search": "",
"Search": "",
"Search Page": "",
"Search Results": "",
"Quick search": "\u0627\u0644\u0628\u062d\u062b \u0627\u0644\u0633\u0631\u064a\u0639",
"Search": "\u0628\u062d\u062b",
"Search Page": "\u0635\u0641\u062d\u0629 \u0627\u0644\u0628\u062d\u062b",
"Search Results": "\u0646\u062a\u0627\u0626\u062c \u0627\u0644\u0628\u062d\u062b",
"Search finished, found %s page(s) matching the search query.": "",
"Search within %(docstitle)s": "\u0627\u0644\u0628\u062d\u062b \u0636\u0645\u0646 %(docstitle)s",
"Searching": "",
"Searching for multiple words only shows matches that contain\n all words.": "",
"Show Source": "",
"Table of Contents": "",
"This Page": "",
"Welcome! This is": "",
"Show Source": "\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u0645\u0635\u062f\u0631",
"Table of Contents": "\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0645\u062d\u062a\u0648\u064a\u0627\u062a",
"This Page": "\u0647\u0630\u0647 \u0627\u0644\u0635\u0641\u062d\u0629",
"Welcome! This is": "\u0623\u0647\u0644\u0627 \u0648\u0633\u0647\u0644\u0627 \u0647\u0630\u0627",
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "",
"all functions, classes, terms": "",
"can be huge": "",
"last updated": "",
"lists all sections and subsections": "",
"next chapter": "\u0627\u0644\u0641\u0635\u0644 \u0627\u0644\u062a\u0627\u0644\u064a",
"previous chapter": "",
"previous chapter": "\u0627\u0644\u0642\u0633\u0645 \u0627\u0644\u0633\u0627\u0628\u0642",
"quick access to all modules": "",
"search": "",
"search": "\u0628\u062d\u062b",
"search this documentation": "",
"the documentation for": ""
"the documentation for": "\u0627\u0644\u062a\u0648\u062b\u064a\u0642 \u0644"
},
"plural_expr": "n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5"
});
Binary file modified sphinx/locale/ar/LC_MESSAGES/sphinx.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions sphinx/locale/ar/LC_MESSAGES/sphinx.po
Expand Up @@ -641,7 +641,7 @@ msgstr ""
#: sphinx/builders/latex/__init__.py:429 sphinx/builders/texinfo.py:186
#, python-format
msgid "cannot copy image file %r: %s"
msgstr "لا تستطيع نسخة ملف صورة %s:"
msgstr ""

#: sphinx/builders/_epub_base.py:435
#, python-format
Expand Down Expand Up @@ -909,7 +909,7 @@ msgstr "صفحة الHTML موجودة في %(outdir)s"
#: sphinx/builders/html/__init__.py:372
#, python-format
msgid "Failed to read build info file: %r"
msgstr "فشل في قراءة معلومات ملف البناء"
msgstr ""

#: sphinx/builders/html/__init__.py:466 sphinx/builders/latex/__init__.py:187
#: sphinx/transforms/__init__.py:116 sphinx/writers/manpage.py:99
Expand Down
2 changes: 1 addition & 1 deletion sphinx/locale/bg/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "",
"Contents": "",
"Copyright": "",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "",
"Full index on one page": "",
"General Index": "",
Expand Down
Binary file modified sphinx/locale/bg/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/bn/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "\u09aa\u09c2\u09b0\u09cd\u09a3\u09be\u0999\u09cd\u0997 \u09b8\u09c2\u099a\u09c0\u09aa\u09a4\u09cd\u09b0",
"Contents": "",
"Copyright": "\u0995\u09aa\u09bf\u09b0\u09be\u0987\u099f",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "<a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s \u09a6\u09bf\u09df\u09c7 \u09a4\u09c8\u09b0\u09c0\u0964",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "",
"Full index on one page": "\u098f\u0995 \u09aa\u09be\u09a4\u09be\u09df \u09b8\u09ae\u09cd\u09aa\u09c2\u09b0\u09cd\u09a3 \u0987\u09a8\u09a1\u09c7\u0995\u09cd\u09b8",
"General Index": "\u09b8\u09be\u09a7\u09be\u09b0\u09a3 \u0987\u09a8\u09a1\u09c7\u0995\u09cd\u09b8",
Expand Down
Binary file modified sphinx/locale/bn/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/ca/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "Taula de Contingut Completa",
"Contents": "",
"Copyright": "Copyright",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Creat amb <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "",
"Full index on one page": "\u00cdndex complet en una p\u00e0gina",
"General Index": "\u00cdndex General",
Expand Down
Binary file modified sphinx/locale/ca/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/cak/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "",
"Contents": "",
"Copyright": "",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "",
"Full index on one page": "",
"General Index": "Konojel cholwuj",
Expand Down
Binary file modified sphinx/locale/cak/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/cs/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "Celkov\u00fd obsah",
"Contents": "Obsah",
"Copyright": "Ve\u0161ker\u00e1 pr\u00e1va vyhrazena",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Vytvo\u0159eno pomoc\u00ed <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "Rozbalit bo\u010dn\u00ed li\u0161tu",
"Full index on one page": "Cel\u00fd rejst\u0159\u00edk na jedn\u00e9 str\u00e1nce",
"General Index": "Obecn\u00fd rejst\u0159\u00edk",
Expand Down
Binary file modified sphinx/locale/cs/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/cy/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "Tabl Cynnwys Llawn",
"Contents": "Cynnwys",
"Copyright": "Hawlfraint",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Cr\u8c37wyd gan ddefnyddio <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "Ehangu'r bar ochr",
"Full index on one page": "Indecs llawn ar un tudalen",
"General Index": "Indecs cyffredinol",
Expand Down
Binary file modified sphinx/locale/cy/LC_MESSAGES/sphinx.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions sphinx/locale/da/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "Fuldst\u00e6ndig indholdsfortegnelse",
"Contents": "Indhold",
"Copyright": "Ophavsret",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Bygget med <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "Udfold sidebj\u00e6lke",
"Full index on one page": "Fuldt indeks p\u00e5 \u00e9n side",
"General Index": "Generelt indeks",
Expand Down Expand Up @@ -42,7 +42,7 @@ Documentation.addTranslations({
"Search finished, found %s page(s) matching the search query.": "S\u00f8gning f\u00e6rdig, fandt %s sider der matcher s\u00f8geforesp\u00f8rgslen.",
"Search within %(docstitle)s": "S\u00f8g i %(docstitle)s",
"Searching": "S\u00f8ger",
"Searching for multiple words only shows matches that contain\n all words.": "",
"Searching for multiple words only shows matches that contain\n all words.": "Bem\u00e6rk: Hvis du s\u00f8ger efter flere ord, vises kun resultater der indeholder alle ordene.",
"Show Source": "Vis kilde",
"Table of Contents": "",
"This Page": "Denne side",
Expand Down
Binary file modified sphinx/locale/da/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/de/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "Vollst\u00e4ndiges Inhaltsverzeichnis",
"Contents": "Inhalt",
"Copyright": "Copyright",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Mit <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s erstellt.",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "Seitenleiste ausklappen",
"Full index on one page": "Gesamtes Stichwortverzeichnis auf einer Seite",
"General Index": "Stichwortverzeichnis",
Expand Down
Binary file modified sphinx/locale/de/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/el/LC_MESSAGES/sphinx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified sphinx/locale/el/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/eo/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "",
"Contents": "",
"Copyright": "A\u016dtora rajto",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "",
"Full index on one page": "",
"General Index": "Indico universala",
Expand Down
Binary file modified sphinx/locale/eo/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/es/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "\u00cdndice de contenidos completo",
"Contents": "Contenidos",
"Copyright": "Copyright",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Creado con <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "Expandir barra lateral",
"Full index on one page": "\u00cdndice completo en una p\u00e1gina",
"General Index": "\u00cdndice General",
Expand Down
Binary file modified sphinx/locale/es/LC_MESSAGES/sphinx.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions sphinx/locale/et/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "T\u00e4ielik sisukorratabel",
"Contents": "Sisukord",
"Copyright": "Autori\u00f5igus",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Loodud <a href=\"http://sphinx-doc.org/\">Sphinxiga</a> (versioon: %(sphinx_version)s).",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "N\u00e4ita k\u00fclgriba",
"Full index on one page": "T\u00e4isindeks \u00fchel lehel",
"General Index": "\u00dcldindeks",
Expand Down Expand Up @@ -47,7 +47,7 @@ Documentation.addTranslations({
"Table of Contents": "Sisukorratabel",
"This Page": "K\u00e4esolev leht",
"Welcome! This is": "Tervitused! See on",
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Sinu otsingule ei vastanud \u00fckski dokument. Palun veendu, et k\u00f5ik sisestatud s\u00f5nad on \u00f5igesti kirjutatud ja sa oled valikud piisaval hulgal kategooriaid.",
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Sinu otsingule ei vastanud \u00fckski dokument. Palun veendu, et k\u00f5ik sisestatud s\u00f5nad on \u00f5igesti kirjutatud ja sa oled valinud piisavalt kategooriaid.",
"all functions, classes, terms": "k\u00f5ik funktsioonid, klassid ja terminid",
"can be huge": "v\u00f5ib olla v\u00e4ga suur",
"last updated": "viimati uuendatud",
Expand Down
Binary file modified sphinx/locale/et/LC_MESSAGES/sphinx.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion sphinx/locale/eu/LC_MESSAGES/sphinx.js
Expand Up @@ -13,7 +13,7 @@ Documentation.addTranslations({
"Complete Table of Contents": "Eduki taula osoa",
"Contents": "Edukiak",
"Copyright": "Copyright",
"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "<a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s erabiliz sortutakoa.",
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
"Expand sidebar": "Alboko barra luzatu",
"Full index on one page": "Indize guztia orri batean",
"General Index": "Indize orokorra",
Expand Down
Binary file modified sphinx/locale/eu/LC_MESSAGES/sphinx.mo
Binary file not shown.

0 comments on commit 71e7320

Please sign in to comment.