Skip to content

Commit ce31e1c

Browse files
authored
Remove deprecated items for Sphinx 6.0 (#10471)
1 parent 7e68154 commit ce31e1c

34 files changed

+33
-13989
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6507,7 +6507,7 @@ Features added
65076507
* HTML builder:
65086508

65096509
- Added ``pyramid`` theme.
6510-
- #559: `html_add_permalinks` is now a string giving the
6510+
- #559: ``html_add_permalinks`` is now a string giving the
65116511
text to display in permalinks.
65126512
- #259: HTML table rows now have even/odd CSS classes to enable
65136513
"Zebra styling".

LICENSE

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -107,61 +107,6 @@ smartypants.py license::
107107
such damage.
108108
----------------------------------------------------------------------
109109

110-
The included JQuery JavaScript library is available under the MIT
111-
license:
112-
113-
----------------------------------------------------------------------
114-
Copyright (c) 2008 John Resig, https://jquery.com/
115-
116-
Permission is hereby granted, free of charge, to any person obtaining
117-
a copy of this software and associated documentation files (the
118-
"Software"), to deal in the Software without restriction, including
119-
without limitation the rights to use, copy, modify, merge, publish,
120-
distribute, sublicense, and/or sell copies of the Software, and to
121-
permit persons to whom the Software is furnished to do so, subject to
122-
the following conditions:
123-
124-
The above copyright notice and this permission notice shall be
125-
included in all copies or substantial portions of the Software.
126-
127-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
128-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
129-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
130-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
131-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
132-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
133-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
134-
----------------------------------------------------------------------
135-
136-
The included Underscore JavaScript library is available under the MIT
137-
license:
138-
139-
----------------------------------------------------------------------
140-
Copyright (c) 2009 Jeremy Ashkenas, DocumentCloud
141-
142-
Permission is hereby granted, free of charge, to any person
143-
obtaining a copy of this software and associated documentation
144-
files (the "Software"), to deal in the Software without
145-
restriction, including without limitation the rights to use,
146-
copy, modify, merge, publish, distribute, sublicense, and/or sell
147-
copies of the Software, and to permit persons to whom the
148-
Software is furnished to do so, subject to the following
149-
conditions:
150-
151-
The above copyright notice and this permission notice shall be
152-
included in all copies or substantial portions of the Software.
153-
154-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
155-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
156-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
157-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
158-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
159-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
160-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
161-
OTHER DEALINGS IN THE SOFTWARE.
162-
163-
-------------------------------------------------------------------------------
164-
165110
The included implementation of NumpyDocstring._parse_numpydoc_see_also_section
166111
was derived from code under the following license:
167112

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
epub_post_files = [('usage/installation.xhtml', 'Installing Sphinx'),
4545
('develop.xhtml', 'Sphinx development')]
4646
epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js',
47-
'_static/jquery.js', '_static/searchtools.js',
48-
'_static/underscore.js', '_static/basic.css',
47+
'_static/searchtools.js',
48+
'_static/basic.css',
4949
'_static/language_data.js',
5050
'search.html', '_static/websupport.js']
5151
epub_fix_images = False

doc/usage/configuration.rst

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,20 +1017,6 @@ that use Sphinx's HTMLWriter class.
10171017

10181018
.. versionadded:: 1.8
10191019

1020-
.. confval:: html_codeblock_linenos_style
1021-
1022-
The style of line numbers for code-blocks.
1023-
1024-
* ``'table'`` -- display line numbers using ``<table>`` tag
1025-
* ``'inline'`` -- display line numbers using ``<span>`` tag (default)
1026-
1027-
.. versionadded:: 3.2
1028-
.. versionchanged:: 4.0
1029-
1030-
It defaults to ``'inline'``.
1031-
1032-
.. deprecated:: 4.0
1033-
10341020
.. confval:: html_context
10351021

10361022
A dictionary of values to pass into the template engine's context for all
@@ -1181,24 +1167,6 @@ that use Sphinx's HTMLWriter class.
11811167
.. deprecated:: 1.6
11821168
To disable smart quotes, use rather :confval:`smartquotes`.
11831169

1184-
.. confval:: html_add_permalinks
1185-
1186-
Sphinx will add "permalinks" for each heading and description environment as
1187-
paragraph signs that become visible when the mouse hovers over them.
1188-
1189-
This value determines the text for the permalink; it defaults to ``"¶"``.
1190-
Set it to ``None`` or the empty string to disable permalinks.
1191-
1192-
.. versionadded:: 0.6
1193-
Previously, this was always activated.
1194-
1195-
.. versionchanged:: 1.1
1196-
This can now be a string to select the actual text of the link.
1197-
Previously, only boolean values were accepted.
1198-
1199-
.. deprecated:: 3.5
1200-
This has been replaced by :confval:`html_permalinks`
1201-
12021170
.. confval:: html_permalinks
12031171

12041172
If true, Sphinx will add "permalinks" for each heading and description
@@ -2768,24 +2736,6 @@ Options for the C domain
27682736

27692737
.. versionadded:: 4.0.3
27702738

2771-
.. confval:: c_allow_pre_v3
2772-
2773-
A boolean (default ``False``) controlling whether to parse and try to
2774-
convert pre-v3 style type directives and type roles.
2775-
2776-
.. versionadded:: 3.2
2777-
.. deprecated:: 3.2
2778-
Use the directives and roles added in v3.
2779-
2780-
.. confval:: c_warn_on_allowed_pre_v3
2781-
2782-
A boolean (default ``True``) controlling whether to warn when a pre-v3
2783-
style type directive/role is parsed and converted.
2784-
2785-
.. versionadded:: 3.2
2786-
.. deprecated:: 3.2
2787-
Use the directives and roles added in v3.
2788-
27892739
.. _cpp-config:
27902740

27912741
Options for the C++ domain

sphinx/application.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import os
77
import pickle
88
import sys
9-
import warnings
109
from collections import deque
1110
from io import StringIO
1211
from os import path
@@ -22,7 +21,6 @@
2221
import sphinx
2322
from sphinx import locale, package_dir
2423
from sphinx.config import Config
25-
from sphinx.deprecation import RemovedInSphinx60Warning
2624
from sphinx.domains import Domain, Index
2725
from sphinx.environment import BuildEnvironment
2826
from sphinx.environment.collectors import EnvironmentCollector
@@ -1050,26 +1048,6 @@ def add_css_file(self, filename: str, priority: int = 500, **kwargs: Any) -> Non
10501048
if hasattr(self.builder, 'add_css_file'):
10511049
self.builder.add_css_file(filename, priority=priority, **kwargs) # type: ignore
10521050

1053-
def add_stylesheet(self, filename: str, alternate: bool = False, title: str = None
1054-
) -> None:
1055-
"""An alias of :meth:`add_css_file`.
1056-
1057-
.. deprecated:: 1.8
1058-
"""
1059-
logger.warning('The app.add_stylesheet() is deprecated. '
1060-
'Please use app.add_css_file() instead.')
1061-
1062-
attributes = {} # type: Dict[str, Any]
1063-
if alternate:
1064-
attributes['rel'] = 'alternate stylesheet'
1065-
else:
1066-
attributes['rel'] = 'stylesheet'
1067-
1068-
if title:
1069-
attributes['title'] = title
1070-
1071-
self.add_css_file(filename, **attributes)
1072-
10731051
def add_latex_package(self, packagename: str, options: str = None,
10741052
after_hyperref: bool = False) -> None:
10751053
r"""Register a package to include in the LaTeX source code.
@@ -1286,12 +1264,6 @@ def set_html_assets_policy(self, policy):
12861264
raise ValueError('policy %s is not supported' % policy)
12871265
self.registry.html_assets_policy = policy
12881266

1289-
@property
1290-
def html_themes(self) -> Dict[str, str]:
1291-
warnings.warn('app.html_themes is deprecated.',
1292-
RemovedInSphinx60Warning)
1293-
return self.registry.html_themes
1294-
12951267

12961268
class TemplateBridge:
12971269
"""

sphinx/builders/html/__init__.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from sphinx import version_info as sphinx_version
2424
from sphinx.application import Sphinx
2525
from sphinx.builders import Builder
26-
from sphinx.config import ENUM, Config
26+
from sphinx.config import Config
2727
from sphinx.deprecation import RemovedInSphinx70Warning, deprecated_alias
2828
from sphinx.domains import Domain, Index, IndexEntry
2929
from sphinx.environment.adapters.asset import ImageAdapter
@@ -328,11 +328,6 @@ def init_js_files(self) -> None:
328328
self.script_files = []
329329
self.add_js_file('documentation_options.js', id="documentation_options",
330330
data_url_root='', priority=200)
331-
# Remove frameworks and compatability module below in Sphinx 6.0
332-
# xref RemovedInSphinx60Warning
333-
self.add_js_file('jquery.js', priority=200)
334-
self.add_js_file('underscore.js', priority=200)
335-
self.add_js_file('_sphinx_javascript_frameworks_compat.js', priority=200)
336331
self.add_js_file('doctools.js', priority=200)
337332

338333
for filename, attrs in self.app.registry.js_files:
@@ -1290,32 +1285,6 @@ def validate_html_favicon(app: Sphinx, config: Config) -> None:
12901285
config.html_favicon = None # type: ignore
12911286

12921287

1293-
class _stable_repr_object():
1294-
1295-
def __repr__(self):
1296-
return '<object>'
1297-
1298-
1299-
UNSET = _stable_repr_object()
1300-
1301-
1302-
def migrate_html_add_permalinks(app: Sphinx, config: Config) -> None:
1303-
"""Migrate html_add_permalinks to html_permalinks*."""
1304-
html_add_permalinks = config.html_add_permalinks
1305-
if html_add_permalinks is UNSET:
1306-
return
1307-
1308-
# RemovedInSphinx60Warning
1309-
logger.warning(__('html_add_permalinks has been deprecated since v3.5.0. '
1310-
'Please use html_permalinks and html_permalinks_icon instead.'))
1311-
if not html_add_permalinks:
1312-
config.html_permalinks = False # type: ignore[attr-defined]
1313-
return
1314-
1315-
config.html_permalinks_icon = html.escape( # type: ignore[attr-defined]
1316-
html_add_permalinks
1317-
)
1318-
13191288
# for compatibility
13201289
import sphinxcontrib.serializinghtml # NOQA
13211290

@@ -1352,7 +1321,6 @@ def setup(app: Sphinx) -> Dict[str, Any]:
13521321
app.add_config_value('html_sidebars', {}, 'html')
13531322
app.add_config_value('html_additional_pages', {}, 'html')
13541323
app.add_config_value('html_domain_indices', True, 'html', [list])
1355-
app.add_config_value('html_add_permalinks', UNSET, 'html')
13561324
app.add_config_value('html_permalinks', True, 'html')
13571325
app.add_config_value('html_permalinks_icon', '¶', 'html')
13581326
app.add_config_value('html_use_index', True, 'html')
@@ -1375,8 +1343,6 @@ def setup(app: Sphinx) -> Dict[str, Any]:
13751343
app.add_config_value('html_search_scorer', '', None)
13761344
app.add_config_value('html_scaled_image_link', True, 'html')
13771345
app.add_config_value('html_baseurl', '', 'html')
1378-
app.add_config_value('html_codeblock_linenos_style', 'inline', 'html', # RemovedInSphinx60Warning # NOQA
1379-
ENUM('table', 'inline'))
13801346
app.add_config_value('html_math_renderer', None, 'env')
13811347
app.add_config_value('html4_writer', False, 'html')
13821348

@@ -1387,7 +1353,6 @@ def setup(app: Sphinx) -> Dict[str, Any]:
13871353
# event handlers
13881354
app.connect('config-inited', convert_html_css_files, priority=800)
13891355
app.connect('config-inited', convert_html_js_files, priority=800)
1390-
app.connect('config-inited', migrate_html_add_permalinks, priority=800)
13911356
app.connect('config-inited', validate_html_extra_path, priority=800)
13921357
app.connect('config-inited', validate_html_static_path, priority=800)
13931358
app.connect('config-inited', validate_html_logo, priority=800)

sphinx/cmd/quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def write_file(fpath: str, content: str, newline: str = None) -> None:
376376
if template._has_custom_template('quickstart/master_doc.rst_t'):
377377
msg = ('A custom template `master_doc.rst_t` found. It has been renamed to '
378378
'`root_doc.rst_t`. Please rename it on your project too.')
379-
print(colorize('red', msg)) # RemovedInSphinx60Warning
379+
print(colorize('red', msg))
380380
write_file(masterfile, template.render('quickstart/master_doc.rst_t', d))
381381
else:
382382
write_file(masterfile, template.render('quickstart/root_doc.rst_t', d))

sphinx/deprecation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
from typing import Any, Dict, Type
77

88

9-
class RemovedInSphinx60Warning(DeprecationWarning):
9+
class RemovedInSphinx70Warning(DeprecationWarning):
1010
pass
1111

1212

13-
class RemovedInSphinx70Warning(PendingDeprecationWarning):
13+
class RemovedInSphinx80Warning(PendingDeprecationWarning):
1414
pass
1515

1616

17-
RemovedInNextVersionWarning = RemovedInSphinx60Warning
17+
RemovedInNextVersionWarning = RemovedInSphinx70Warning
1818

1919

2020
def deprecated_alias(modname: str, objects: Dict[str, object],

sphinx/directives/patches.py

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import os
2-
import warnings
32
from os import path
4-
from typing import TYPE_CHECKING, Any, Dict, List, Sequence, Tuple, cast
3+
from typing import TYPE_CHECKING, Any, Dict, List, Sequence, cast
54

65
from docutils import nodes
7-
from docutils.nodes import Node, make_id, system_message
6+
from docutils.nodes import Node, make_id
87
from docutils.parsers.rst import directives
98
from docutils.parsers.rst.directives import images, tables
109
from docutils.parsers.rst.roles import set_classes
1110

1211
from sphinx import addnodes
13-
from sphinx.deprecation import RemovedInSphinx60Warning
1412
from sphinx.directives import optional_int
1513
from sphinx.domains.math import MathDomain
1614
from sphinx.locale import __
@@ -78,24 +76,6 @@ def run(self) -> Sequence[Node]:
7876
return result
7977

8078

81-
class RSTTable(tables.RSTTable):
82-
"""The table directive which sets source and line information to its caption.
83-
84-
Only for docutils-0.13 or older version."""
85-
86-
def run(self) -> List[Node]:
87-
warnings.warn('RSTTable is deprecated.',
88-
RemovedInSphinx60Warning)
89-
return super().run()
90-
91-
def make_title(self) -> Tuple[nodes.title, List[system_message]]:
92-
title, message = super().make_title()
93-
if title:
94-
set_source_info(self, title)
95-
96-
return title, message
97-
98-
9979
class CSVTable(tables.CSVTable):
10080
"""The csv-table directive which searches a CSV file from Sphinx project's source
10181
directory when an absolute path is given via :file: option.
@@ -118,24 +98,6 @@ def run(self) -> List[Node]:
11898
return super().run()
11999

120100

121-
class ListTable(tables.ListTable):
122-
"""The list-table directive which sets source and line information to its caption.
123-
124-
Only for docutils-0.13 or older version."""
125-
126-
def run(self) -> List[Node]:
127-
warnings.warn('ListTable is deprecated.',
128-
RemovedInSphinx60Warning)
129-
return super().run()
130-
131-
def make_title(self) -> Tuple[nodes.title, List[system_message]]:
132-
title, message = super().make_title()
133-
if title:
134-
set_source_info(self, title)
135-
136-
return title, message
137-
138-
139101
class Code(SphinxDirective):
140102
"""Parse and mark up content of a code block.
141103

0 commit comments

Comments
 (0)