Sphinx 7.4.3__py3-none-any.whl → 7.4.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Sphinx might be problematic. Click here for more details.

sphinx/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """The Sphinx documentation toolchain."""
2
2
 
3
- __version__ = '7.4.3'
3
+ __version__ = '7.4.5'
4
4
  __display_version__ = __version__ # used for command line version
5
5
 
6
6
  # Keep this file executable as-is in Python 3!
@@ -27,7 +27,7 @@ warnings.filterwarnings(
27
27
  #:
28
28
  #: .. versionadded:: 1.2
29
29
  #: Before version 1.2, check the string ``sphinx.__version__``.
30
- version_info = (7, 4, 3, 'final', 0)
30
+ version_info = (7, 4, 5, 'final', 0)
31
31
 
32
32
  package_dir = os.path.abspath(os.path.dirname(__file__))
33
33
 
@@ -982,11 +982,10 @@ class StandaloneHTMLBuilder(Builder):
982
982
  matched = pattern
983
983
  sidebars = pat_sidebars
984
984
 
985
- if len(sidebars) == 0:
986
- # keep defaults
987
- pass
988
-
989
- ctx['sidebars'] = list(sidebars)
985
+ # See error_on_html_sidebars_string_values.
986
+ # Replace with simple list coercion in Sphinx 8.0
987
+ # xref: RemovedInSphinx80Warning
988
+ ctx['sidebars'] = sidebars
990
989
 
991
990
  # --------- these are overwritten by the serialization builder
992
991
 
@@ -1287,6 +1286,25 @@ def validate_html_favicon(app: Sphinx, config: Config) -> None:
1287
1286
  config.html_favicon = None
1288
1287
 
1289
1288
 
1289
+ def error_on_html_sidebars_string_values(app: Sphinx, config: Config) -> None:
1290
+ """Support removed in Sphinx 2."""
1291
+ errors = {}
1292
+ for pattern, pat_sidebars in config.html_sidebars.items():
1293
+ if isinstance(pat_sidebars, str):
1294
+ errors[pattern] = [pat_sidebars]
1295
+ if not errors:
1296
+ return
1297
+ msg = __("Values in 'html_sidebars' must be a list of strings. "
1298
+ "At least one pattern has a string value: %s. "
1299
+ "Change to `html_sidebars = %r`.")
1300
+ bad_patterns = ', '.join(map(repr, errors))
1301
+ fixed = config.html_sidebars | errors
1302
+ logger.error(msg, bad_patterns, fixed)
1303
+ # Enable hard error in next major version.
1304
+ # xref: RemovedInSphinx80Warning
1305
+ # raise ConfigError(msg % (bad_patterns, fixed))
1306
+
1307
+
1290
1308
  def error_on_html_4(_app: Sphinx, config: Config) -> None:
1291
1309
  """Error on HTML 4."""
1292
1310
  if config.html4_writer:
@@ -1357,6 +1375,7 @@ def setup(app: Sphinx) -> ExtensionMetadata:
1357
1375
  app.connect('config-inited', validate_html_static_path, priority=800)
1358
1376
  app.connect('config-inited', validate_html_logo, priority=800)
1359
1377
  app.connect('config-inited', validate_html_favicon, priority=800)
1378
+ app.connect('config-inited', error_on_html_sidebars_string_values, priority=800)
1360
1379
  app.connect('config-inited', error_on_html_4, priority=800)
1361
1380
  app.connect('builder-inited', validate_math_renderer)
1362
1381
  app.connect('html-page-context', setup_resource_paths)
sphinx/ext/todo.py CHANGED
@@ -215,6 +215,9 @@ def latex_visit_todo_node(self: LaTeXTranslator, node: todo_node) -> None:
215
215
  title_node = cast(nodes.title, node[0])
216
216
  title = texescape.escape(title_node.astext(), self.config.latex_engine)
217
217
  self.body.append('%s:}' % title)
218
+ self.no_latex_floats += 1
219
+ if self.table:
220
+ self.table.has_problematic = True
218
221
  node.pop(0)
219
222
  else:
220
223
  raise nodes.SkipNode
@@ -222,6 +225,7 @@ def latex_visit_todo_node(self: LaTeXTranslator, node: todo_node) -> None:
222
225
 
223
226
  def latex_depart_todo_node(self: LaTeXTranslator, node: todo_node) -> None:
224
227
  self.body.append('\\end{sphinxtodo}\n')
228
+ self.no_latex_floats -= 1
225
229
 
226
230
 
227
231
  def setup(app: Sphinx) -> ExtensionMetadata:
@@ -108,6 +108,7 @@
108
108
  \vbox{}% get correct baseline from above
109
109
  \LTpre\z@skip\LTpost\z@skip % set to zero longtable's own skips
110
110
  \edef\sphinxbaselineskip{\dimexpr\the\dimexpr\baselineskip\relax\relax}%
111
+ \spx@inframedtrue % message to sphinxheavybox
111
112
  }%
112
113
  % Compatibility with caption package
113
114
  \def\sphinxthelongtablecaptionisattop{%
@@ -121,7 +122,9 @@
121
122
  \def\sphinxatlongtableend{\@nobreakfalse % latex3/latex2e#173
122
123
  \prevdepth\z@\vskip\sphinxtablepost\relax}%
123
124
  % B. Table with tabular or tabulary
124
- \def\sphinxattablestart{\par\vskip\dimexpr\sphinxtablepre\relax}%
125
+ \def\sphinxattablestart{\par\vskip\dimexpr\sphinxtablepre\relax
126
+ \spx@inframedtrue % message to sphinxheavybox
127
+ }%
125
128
  \let\sphinxattableend\sphinxatlongtableend
126
129
  % This is used by tabular and tabulary templates
127
130
  \newcommand*\sphinxcapstartof[1]{%
sphinx/util/inventory.py CHANGED
@@ -126,7 +126,8 @@ class InventoryFile:
126
126
  invdata: Inventory = {}
127
127
  projname = stream.readline().rstrip()[11:]
128
128
  version = stream.readline().rstrip()[11:]
129
- potential_ambiguities = set()
129
+ # definition -> priority, location, display name
130
+ potential_ambiguities: dict[str, tuple[str, str, str]] = {}
130
131
  actual_ambiguities = set()
131
132
  line = stream.readline()
132
133
  if 'zlib' not in line:
@@ -155,10 +156,16 @@ class InventoryFile:
155
156
  # * 'term': https://github.com/sphinx-doc/sphinx/issues/9291
156
157
  # * 'label': https://github.com/sphinx-doc/sphinx/issues/12008
157
158
  definition = f"{type}:{name}"
158
- if definition.lower() in potential_ambiguities:
159
- actual_ambiguities.add(definition)
159
+ content = prio, location, dispname
160
+ lowercase_definition = definition.lower()
161
+ if lowercase_definition in potential_ambiguities:
162
+ if potential_ambiguities[lowercase_definition] != content:
163
+ actual_ambiguities.add(definition)
164
+ else:
165
+ logger.debug(__("inventory <%s> contains duplicate definitions of %s"),
166
+ uri, definition, type='intersphinx', subtype='external')
160
167
  else:
161
- potential_ambiguities.add(definition.lower())
168
+ potential_ambiguities[lowercase_definition] = content
162
169
  if location.endswith('$'):
163
170
  location = location[:-1] + name
164
171
  location = join(uri, location)
sphinx/writers/latex.py CHANGED
@@ -306,6 +306,7 @@ class LaTeXTranslator(SphinxTranslator):
306
306
  self.in_term = 0
307
307
  self.needs_linetrimming = 0
308
308
  self.in_minipage = 0
309
+ # only used by figure inside an admonition
309
310
  self.no_latex_floats = 0
310
311
  self.first_document = 1
311
312
  self.this_is_the_title = 1
@@ -966,11 +967,15 @@ class LaTeXTranslator(SphinxTranslator):
966
967
  def visit_seealso(self, node: Element) -> None:
967
968
  self.body.append(BLANKLINE)
968
969
  self.body.append(r'\begin{sphinxseealso}{%s:}' % admonitionlabels['seealso'] + CR)
970
+ self.no_latex_floats += 1
971
+ if self.table:
972
+ self.table.has_problematic = True
969
973
 
970
974
  def depart_seealso(self, node: Element) -> None:
971
975
  self.body.append(BLANKLINE)
972
976
  self.body.append(r'\end{sphinxseealso}')
973
977
  self.body.append(BLANKLINE)
978
+ self.no_latex_floats -= 1
974
979
 
975
980
  def visit_rubric(self, node: nodes.rubric) -> None:
976
981
  if len(node) == 1 and node.astext() in ('Footnotes', _('Footnotes')):
@@ -1512,6 +1517,8 @@ class LaTeXTranslator(SphinxTranslator):
1512
1517
  if self.no_latex_floats:
1513
1518
  align = "H"
1514
1519
  if self.table:
1520
+ # Blank line is needed if text precedes
1521
+ self.body.append(BLANKLINE)
1515
1522
  # TODO: support align option
1516
1523
  if 'width' in node:
1517
1524
  length = self.latex_image_length(node['width'])
@@ -1580,6 +1587,8 @@ class LaTeXTranslator(SphinxTranslator):
1580
1587
  def visit_admonition(self, node: Element) -> None:
1581
1588
  self.body.append(CR + r'\begin{sphinxadmonition}{note}')
1582
1589
  self.no_latex_floats += 1
1590
+ if self.table:
1591
+ self.table.has_problematic = True
1583
1592
 
1584
1593
  def depart_admonition(self, node: Element) -> None:
1585
1594
  self.body.append(r'\end{sphinxadmonition}' + CR)
@@ -1590,6 +1599,8 @@ class LaTeXTranslator(SphinxTranslator):
1590
1599
  self.body.append(CR + r'\begin{sphinxadmonition}{%s}{%s:}' %
1591
1600
  (node.tagname, label))
1592
1601
  self.no_latex_floats += 1
1602
+ if self.table:
1603
+ self.table.has_problematic = True
1593
1604
 
1594
1605
  def _depart_named_admonition(self, node: Element) -> None:
1595
1606
  self.body.append(r'\end{sphinxadmonition}' + CR)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Sphinx
3
- Version: 7.4.3
3
+ Version: 7.4.5
4
4
  Summary: Python documentation generator
5
5
  Author-email: Georg Brandl <georg@python.org>
6
6
  Requires-Python: >=3.9
@@ -1,4 +1,4 @@
1
- sphinx/__init__.py,sha256=yHiprJSiTyxDdQrMU1sRfPUr6-4sbs698kAwfh1gHN0,1690
1
+ sphinx/__init__.py,sha256=TqYrt2tp3rjs1RkaHALTKgB-3G0yAjYd6Jpp5JDsPgs,1690
2
2
  sphinx/__main__.py,sha256=wIifwXlZHdi4gtQmkJ6KF0BsflvD9o0Wd5nARTdJc8A,127
3
3
  sphinx/addnodes.py,sha256=EQTIi9Zta6DaNa-2WGE3l9AVjdp7WzwwrfwRnax8vXE,18707
4
4
  sphinx/application.py,sha256=5QXM7tYRt1s4q00GHPtAK2EIxu6G_UkzMB3MOKOkuUI,57793
@@ -35,7 +35,7 @@ sphinx/builders/singlehtml.py,sha256=mYsB_J5AOi7wEswNbH0v5XXZnmZkBmLRHJaQtz_nB-c
35
35
  sphinx/builders/texinfo.py,sha256=cROws1DmYPp4-_uD62Ryu7Vn5Kv-JYIH1YCCm-_SRWU,9804
36
36
  sphinx/builders/text.py,sha256=YCNWggEL5GCjh5lQLT8z_NgVZdMYAHtAHfGAoUAvT0w,2996
37
37
  sphinx/builders/xml.py,sha256=SIblnQLGGzTPTv4xnFFy-Sf66YxP9q1n-28yoVajWhA,3901
38
- sphinx/builders/html/__init__.py,sha256=8xuYeo0zHsOjzlDznGbf4sxz_5wbBZuVButlhOBSWGc,58940
38
+ sphinx/builders/html/__init__.py,sha256=6xiPEQD9dlUZnnrEr7pJnwCPBxqlyZ-Jf9QjJ4f9LKk,59861
39
39
  sphinx/builders/html/_assets.py,sha256=9GhVCpJDTD17WzZavhONH9kqOEGS9glD62kBQ16jLeA,5599
40
40
  sphinx/builders/html/transforms.py,sha256=DhIabbXbvZM8lrT9AvKJb9JoawsmEt__DhpoeXA8Yvw,2597
41
41
  sphinx/builders/latex/__init__.py,sha256=fQvWHt7EuFFQBghaD2_TCwEBaheQKkFbxKu9GIP4lWU,24497
@@ -99,7 +99,7 @@ sphinx/ext/imgmath.py,sha256=01mzOdmIDy5PpS8PT9pErrVfK-Ef9We-czpPCyObicc,15550
99
99
  sphinx/ext/inheritance_diagram.py,sha256=ocxm7JADD3_Ed43jK-LtawoRfO6IowjIGqJU-U7L83g,17490
100
100
  sphinx/ext/linkcode.py,sha256=x4Ku-cssPT771pj5Rp966kPSK20hq06O9pf03asl2lk,2352
101
101
  sphinx/ext/mathjax.py,sha256=ezbvP5pqDlTHhNwhGHj_sbquVLLqM2_8Th5YMIqIOWU,5408
102
- sphinx/ext/todo.py,sha256=_vYZ43QbKVdhvHpNsUXRcu26hLPVFkLEEmpaICU-hMg,8194
102
+ sphinx/ext/todo.py,sha256=xjoaguKakr0Xe6IMZASlCRD7YAlqCaHnK8KYtNL7Z-U,8327
103
103
  sphinx/ext/viewcode.py,sha256=KwmggBvSO0OK9w-WHDPKzG3SLsYNdN9xuJkb7xl8goQ,13792
104
104
  sphinx/ext/autodoc/__init__.py,sha256=aGYSAMwuGYQvIDNp365m7DM839yhn4wu-NfKEKzgktQ,116920
105
105
  sphinx/ext/autodoc/directive.py,sha256=IqDLJnc91_SxqlQkBR2yGoK_ewTzCjGwozCY0eP5HHY,5833
@@ -433,7 +433,7 @@ sphinx/texinputs/sphinxlatexshadowbox.sty,sha256=WOPHKtiNfv3vDun8N7ziIxprd0Dk_G2
433
433
  sphinx/texinputs/sphinxlatexstyleheadings.sty,sha256=jDiLn0iEnclKADiAqjLoxdpyhu_MgwQETOWDgSkMO7c,3445
434
434
  sphinx/texinputs/sphinxlatexstylepage.sty,sha256=fGUYalNjMZq6HTFzP1-3c5VhUfZ63LhSo48Q4F6GyK8,3064
435
435
  sphinx/texinputs/sphinxlatexstyletext.sty,sha256=tbEMGqHjTVXW7PVzTNNcpzi3tFQPFcXqCSxQcjOs53c,6881
436
- sphinx/texinputs/sphinxlatextables.sty,sha256=snOD2ExsHU7c1AyNFLUs3vl8tVroJ4QM_YOK0cmQdpE,57499
436
+ sphinx/texinputs/sphinxlatextables.sty,sha256=TLXNR5Ua92ZK1M2Mkohb7WLVicB4iYE6yj5DvhqniTs,57644
437
437
  sphinx/texinputs/sphinxmanual.cls,sha256=XyBvfQQOEbjSXnY6ckCDRUFou2TzEikpMCZSfA2XX-o,4241
438
438
  sphinx/texinputs/sphinxoptionsgeometry.sty,sha256=D2pTqE7L4wwt-UqbTZWySUksJ1Yj12YSjHv36E9tJOA,2061
439
439
  sphinx/texinputs/sphinxoptionshyperref.sty,sha256=wuvlb09FedUwCyOAzup8_iuabDeaffIFwVFcg_mC-BY,1094
@@ -561,7 +561,7 @@ sphinx/util/i18n.py,sha256=K5smw0FQ3Hkr4Bp17o2BQRMK-8s76edJPsdWgLT5AFM,10542
561
561
  sphinx/util/images.py,sha256=Y5Oy1M_BD6HRsUyWFQ2DvvCL4VDOFHDPZxtYnO8QEfM,3701
562
562
  sphinx/util/index_entries.py,sha256=wEa55m_tez3UFNFEVuIesEQKWavANQ2O-l86k1If0sY,986
563
563
  sphinx/util/inspect.py,sha256=BdltEA-0lZKhCcCa3DmS7kIV7Xf5KZS6d8VKf6uLNMI,33077
564
- sphinx/util/inventory.py,sha256=qaOeDG0HbuD1EKcD1l3fnLtY3ohENEFrixoUBT6tzBU,7467
564
+ sphinx/util/inventory.py,sha256=qjbSlk51LQY2gXZW_d8i3-pyUewisaFpj955jf2IFz0,7973
565
565
  sphinx/util/logging.py,sha256=WokXNrpfjX7kekEE6N59MitS23DzdCpyEw0GTiQovug,20542
566
566
  sphinx/util/matching.py,sha256=pywT5EKjUUJ-PX4H6mm-LA3f37AvYfxwEpraHHrhVsI,5368
567
567
  sphinx/util/math.py,sha256=GuBqbvunQfOE2JpxjFsUoWwujDhWaYELczJIyNGzLhE,1984
@@ -579,13 +579,13 @@ sphinx/util/typing.py,sha256=nSZtWgMw4IqRkjplxPANTlTd7Nj5hvUrT6VLVqThO9M,22617
579
579
  sphinx/writers/__init__.py,sha256=efGdnx4MWlPEDzXACf4Q18Oi3GTyY5Ob14I_j3XXtXc,31
580
580
  sphinx/writers/html.py,sha256=ptitqWUkA4wnY0HuPIjy1GuKG4cOPCuPlAdH7aMRhyg,1604
581
581
  sphinx/writers/html5.py,sha256=KmE-WAPcIX1laEHXBX2H8zRwCDC66vGzys_32UV5yM4,37671
582
- sphinx/writers/latex.py,sha256=n4TNdWkLcdctaKMH85HPAvqhGiTewW83wgz9pl4uT90,92241
582
+ sphinx/writers/latex.py,sha256=rJLo1X-4cMuP-uC_-RJ_4jjtSRYs1S2MwNCT1dJOafg,92659
583
583
  sphinx/writers/manpage.py,sha256=iLoC4i81W52dTl8Kpug65CV1M7cCz1buGgsN7FhazYo,16215
584
584
  sphinx/writers/texinfo.py,sha256=UU3Zrt-zBgdwYgqj4BJFNthggzMr_Gllx2ewBeWrkcI,53451
585
585
  sphinx/writers/text.py,sha256=HEiYXsWXO9QVOazg2V3D0ehGTnK38dAtYP9v0rst684,42964
586
586
  sphinx/writers/xml.py,sha256=NyDl82hCFSRiHrCZV6vBfn4AsAyXH6khtSJEfhOX8a0,1502
587
- sphinx-7.4.3.dist-info/entry_points.txt,sha256=KU_c9jqXj7yyZylSz11XRIXG3gAZApQa0d5DmcfyA7M,188
588
- sphinx-7.4.3.dist-info/LICENSE.rst,sha256=HdZPUFcmQaLySBc9fKvRC5aOUNkxL9Gz5py0p6XGDk4,3135
589
- sphinx-7.4.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
590
- sphinx-7.4.3.dist-info/METADATA,sha256=HdBXZsmIiSOmuAviGIzMMQGQPj_8yMS9Y2rZq7EA-S8,6113
591
- sphinx-7.4.3.dist-info/RECORD,,
587
+ sphinx-7.4.5.dist-info/entry_points.txt,sha256=KU_c9jqXj7yyZylSz11XRIXG3gAZApQa0d5DmcfyA7M,188
588
+ sphinx-7.4.5.dist-info/LICENSE.rst,sha256=HdZPUFcmQaLySBc9fKvRC5aOUNkxL9Gz5py0p6XGDk4,3135
589
+ sphinx-7.4.5.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
590
+ sphinx-7.4.5.dist-info/METADATA,sha256=qyoEdApSTAM6yq2wEt_NxjmWIEDKGjjtN5bBR6O1xiQ,6113
591
+ sphinx-7.4.5.dist-info/RECORD,,
File without changes