Sphinx 7.4.0__py3-none-any.whl → 7.4.2__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.0'
3
+ __version__ = '7.4.2'
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, 0, 'final', 0)
30
+ version_info = (7, 4, 2, 'final', 0)
31
31
 
32
32
  package_dir = os.path.abspath(os.path.dirname(__file__))
33
33
 
@@ -187,17 +187,17 @@ class Rubric(SphinxDirective):
187
187
  option_spec = {
188
188
  'class': directives.class_option,
189
189
  'name': directives.unchanged,
190
- 'level': lambda c: directives.choice(c, ('1', '2', '3', '4', '5', '6')),
190
+ 'heading-level': lambda c: directives.choice(c, ('1', '2', '3', '4', '5', '6')),
191
191
  }
192
192
 
193
- def run(self) -> list[Node]:
193
+ def run(self) -> list[nodes.rubric | nodes.system_message]:
194
194
  set_classes(self.options)
195
195
  rubric_text = self.arguments[0]
196
196
  textnodes, messages = self.parse_inline(rubric_text, lineno=self.lineno)
197
+ if 'heading-level' in self.options:
198
+ self.options['heading-level'] = int(self.options['heading-level'])
197
199
  rubric = nodes.rubric(rubric_text, '', *textnodes, **self.options)
198
200
  self.add_name(rubric)
199
- if 'level' in self.options:
200
- rubric['level'] = int(self.options['level'])
201
201
  return [rubric, *messages]
202
202
 
203
203
 
@@ -59,7 +59,7 @@ default_settings: dict[str, Any] = {
59
59
 
60
60
  # This is increased every time an environment attribute is added
61
61
  # or changed to properly invalidate pickle files.
62
- ENV_VERSION = 61
62
+ ENV_VERSION = 62
63
63
 
64
64
  # config status
65
65
  CONFIG_UNSET = -1
sphinx/util/typing.py CHANGED
@@ -212,7 +212,11 @@ def _is_unpack_form(obj: Any) -> bool:
212
212
 
213
213
  def _typing_internal_name(obj: Any) -> str | None:
214
214
  if sys.version_info[:2] >= (3, 10):
215
- return obj.__name__
215
+ try:
216
+ return obj.__name__
217
+ except AttributeError:
218
+ # e.g. ParamSpecArgs, ParamSpecKwargs
219
+ return ''
216
220
  return getattr(obj, '_name', None)
217
221
 
218
222
 
@@ -237,7 +241,7 @@ def restify(cls: Any, mode: _RestifyMode = 'fully-qualified-except-typing') -> s
237
241
  raise ValueError(msg)
238
242
 
239
243
  # things that are not types
240
- if cls in {None, NoneType}:
244
+ if cls is None or cls == NoneType:
241
245
  return ':py:obj:`None`'
242
246
  if cls is Ellipsis:
243
247
  return '...'
@@ -388,7 +392,7 @@ def stringify_annotation(
388
392
  raise ValueError(msg)
389
393
 
390
394
  # things that are not types
391
- if annotation in {None, NoneType}:
395
+ if annotation is None or annotation == NoneType:
392
396
  return 'None'
393
397
  if annotation is Ellipsis:
394
398
  return '...'
sphinx/writers/html5.py CHANGED
@@ -510,10 +510,10 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
510
510
  super().depart_title(node)
511
511
 
512
512
  # overwritten
513
- def visit_rubric(self, node: Element) -> None:
514
- if "level" in node:
515
- level = node["level"]
516
- if level in (1, 2, 3, 4, 5, 6):
513
+ def visit_rubric(self, node: nodes.rubric) -> None:
514
+ if 'heading-level' in node:
515
+ level = node['heading-level']
516
+ if level in {1, 2, 3, 4, 5, 6}:
517
517
  self.body.append(self.starttag(node, f'h{level}', '', CLASS='rubric'))
518
518
  else:
519
519
  logger.warning(
@@ -527,8 +527,8 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
527
527
  super().visit_rubric(node)
528
528
 
529
529
  # overwritten
530
- def depart_rubric(self, node: Element) -> None:
531
- if level := node.get("level"):
530
+ def depart_rubric(self, node: nodes.rubric) -> None:
531
+ if (level := node.get('heading-level')) in {1, 2, 3, 4, 5, 6}:
532
532
  self.body.append(f'</h{level}>\n')
533
533
  else:
534
534
  super().depart_rubric(node)
sphinx/writers/latex.py CHANGED
@@ -972,12 +972,12 @@ class LaTeXTranslator(SphinxTranslator):
972
972
  self.body.append(r'\end{sphinxseealso}')
973
973
  self.body.append(BLANKLINE)
974
974
 
975
- def visit_rubric(self, node: Element) -> None:
975
+ def visit_rubric(self, node: nodes.rubric) -> None:
976
976
  if len(node) == 1 and node.astext() in ('Footnotes', _('Footnotes')):
977
977
  raise nodes.SkipNode
978
978
  tag = 'subsubsection'
979
- if "level" in node:
980
- level = node["level"]
979
+ if 'heading-level' in node:
980
+ level = node['heading-level']
981
981
  try:
982
982
  tag = self.sectionnames[self.top_sectionlevel - 1 + level]
983
983
  except Exception:
@@ -992,7 +992,7 @@ class LaTeXTranslator(SphinxTranslator):
992
992
  self.context.append('}' + CR)
993
993
  self.in_title = 1
994
994
 
995
- def depart_rubric(self, node: Element) -> None:
995
+ def depart_rubric(self, node: nodes.rubric) -> None:
996
996
  self.in_title = 0
997
997
  self.body.append(self.context.pop())
998
998
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Sphinx
3
- Version: 7.4.0
3
+ Version: 7.4.2
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=d62Tm-O3KPVsvSnDn34bpL4tHlSuhXItJrN4R10PEV8,1690
1
+ sphinx/__init__.py,sha256=lDK1jQBltbq6fbBeFLlrGp62wnx3ipLhR8LBPyXErR0,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
@@ -51,7 +51,7 @@ sphinx/cmd/quickstart.py,sha256=XxF1hMsn7H0VZGy64yLEbTTSFc9ZANZHWIvEk21GOUE,2424
51
51
  sphinx/directives/__init__.py,sha256=PnsmKvTOcRgfwzp8NFfhmdVJfbcDktcHD7sd1fnddNE,15100
52
52
  sphinx/directives/code.py,sha256=yTy4GsZZ6PYKdnhysJpEj3eYRIpDEoYIsWtm9io59p8,18264
53
53
  sphinx/directives/other.py,sha256=IMVRQyPT_zkU34V4A9pdsR8S4HnryoJutYCpt4LnFh8,16492
54
- sphinx/directives/patches.py,sha256=CwiAnkOhMb_huuW3xaoldki1I3bhvqEylaeVutlEB5U,7732
54
+ sphinx/directives/patches.py,sha256=cK4KPUe1U7MOOxQzXshAJEMPKnpG5_T-7Ch5pOB5PXs,7801
55
55
  sphinx/domains/__init__.py,sha256=LLaAZAn0984o2LSYH_UZcEdndE9azmNUDALae74nuRE,15392
56
56
  sphinx/domains/changeset.py,sha256=J9LWgh2dtBAXbX6L3a4J8YB3-wA62AMS1GolKTQsWJ0,5692
57
57
  sphinx/domains/citation.py,sha256=G9i8IYsR1tsGfAln7Z9Z_wNL2FDM2sXbWgTojxN_77I,5767
@@ -73,7 +73,7 @@ sphinx/domains/python/__init__.py,sha256=mWEy28rgBrk1hBGoN5SOTw9PptIg58ghby_1iuL
73
73
  sphinx/domains/python/_annotations.py,sha256=bLay4nHo1L7KxfX2exE2ttTLqwOnMBDVEg7r6v_YeSY,22302
74
74
  sphinx/domains/python/_object.py,sha256=5DjvYfjQwmJToudJQNSogfP4LIAMU8fp6rd-Xe6nhzY,17011
75
75
  sphinx/domains/std/__init__.py,sha256=gXNUycqNBSeFBXg89WStSk9pZsvaS6BuDtTBee-DWoM,49514
76
- sphinx/environment/__init__.py,sha256=-dweW4btgtJsku0MGp4WLEnnN98ZWTaZQ4qgCtFSNWU,32545
76
+ sphinx/environment/__init__.py,sha256=8078TrLXUERa0RbBBLZxwPDndYqhqTZNrwlL2zwzj6A,32545
77
77
  sphinx/environment/adapters/__init__.py,sha256=VnDotW2UbxjWeVITmz7iTsVrzqQcvmLHr3euKqqKHwo,34
78
78
  sphinx/environment/adapters/asset.py,sha256=huGHWMReM80cD9b88thQeqvJZG3G6BCnG_DY2uIZt0Q,418
79
79
  sphinx/environment/adapters/indexentries.py,sha256=v_U51MZyYgkwVcFG0cCVICwSJALjlIxFHCpcxg2Nqbs,8926
@@ -575,17 +575,17 @@ sphinx/util/rst.py,sha256=YY2Wk4Pn1vNQAi1iDjUCYeBYGutYYo4curTpdsVcyKE,3585
575
575
  sphinx/util/tags.py,sha256=K6tiZhx-V60aKZ4Z3ie5kasMYGGV_WPUTq8ncWlWnJM,3927
576
576
  sphinx/util/template.py,sha256=jxQgY24NYYfMc1M951DKQn2oSk0-wxEGqKBPR98eRbc,5146
577
577
  sphinx/util/texescape.py,sha256=eGHE_GX732SVeSHcmprXbOa2euwNh37kREwWPTY1hvY,5442
578
- sphinx/util/typing.py,sha256=7nGQTUAJlv7EqoUgE8VH01B81B_fSnkwgtQeI2A4VOo,22476
578
+ 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
- sphinx/writers/html5.py,sha256=oyNYkmFG8TzPwLFoezcfOG8NRzG5X81bAmLyMeP3XjI,37613
582
- sphinx/writers/latex.py,sha256=5lvrv8j3nfU_fgR0uHXTjbha0hVzbu-Lf8fOC1l0zSw,92215
581
+ sphinx/writers/html5.py,sha256=KmE-WAPcIX1laEHXBX2H8zRwCDC66vGzys_32UV5yM4,37671
582
+ sphinx/writers/latex.py,sha256=n4TNdWkLcdctaKMH85HPAvqhGiTewW83wgz9pl4uT90,92241
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.0.dist-info/entry_points.txt,sha256=KU_c9jqXj7yyZylSz11XRIXG3gAZApQa0d5DmcfyA7M,188
588
- sphinx-7.4.0.dist-info/LICENSE.rst,sha256=HdZPUFcmQaLySBc9fKvRC5aOUNkxL9Gz5py0p6XGDk4,3135
589
- sphinx-7.4.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
590
- sphinx-7.4.0.dist-info/METADATA,sha256=erbPWcF18lvTzKg5XOLnXiMz7zGrVHXE5rU5n1O3YjY,6113
591
- sphinx-7.4.0.dist-info/RECORD,,
587
+ sphinx-7.4.2.dist-info/entry_points.txt,sha256=KU_c9jqXj7yyZylSz11XRIXG3gAZApQa0d5DmcfyA7M,188
588
+ sphinx-7.4.2.dist-info/LICENSE.rst,sha256=HdZPUFcmQaLySBc9fKvRC5aOUNkxL9Gz5py0p6XGDk4,3135
589
+ sphinx-7.4.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
590
+ sphinx-7.4.2.dist-info/METADATA,sha256=FR4tZh9yXkMubBSP2JCgiwF_EG6fMmBxZkJ8qHYQonQ,6113
591
+ sphinx-7.4.2.dist-info/RECORD,,
File without changes