Skip to content

Commit ac0fc4b

Browse files
authored
Remove more deprecated items in Sphinx 6.0 (#10562)
1 parent 7b07874 commit ac0fc4b

7 files changed

Lines changed: 17 additions & 106 deletions

File tree

doc/templating.rst

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,6 @@ in the future.
273273
that handles navigation, not the web browser, such as for HTML help or Qt
274274
help formats. In this case, the sidebar is not included.
275275

276-
.. data:: favicon
277-
278-
The path to the HTML favicon in the static path, or URL to the favicon, or
279-
``''``.
280-
281-
.. deprecated:: 4.0
282-
283-
Recommend to use ``favicon_url`` instead.
284-
285276
.. data:: favicon_url
286277

287278
The relative path to the HTML favicon image from the current document, or
@@ -308,15 +299,6 @@ in the future.
308299

309300
The build date.
310301

311-
.. data:: logo
312-
313-
The path to the HTML logo image in the static path, or URL to the logo, or
314-
``''``.
315-
316-
.. deprecated:: 4.0
317-
318-
Recommend to use ``logo_url`` instead.
319-
320302
.. data:: logo_url
321303

322304
The relative path to the HTML logo image from the current document, or URL

doc/usage/restructuredtext/domains.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -427,17 +427,6 @@ The following directives are provided for module and class contents:
427427
Describe the location where the object is defined. The default value is
428428
the module specified by :rst:dir:`py:currentmodule`.
429429
430-
.. rst:directive:option:: property
431-
:type: no value
432-
433-
Indicate the method is a property.
434-
435-
.. versionadded:: 2.1
436-
437-
.. deprecated:: 4.0
438-
439-
Use :rst:dir:`py:property` instead.
440-
441430
.. rst:directive:option:: staticmethod
442431
:type: no value
443432

sphinx/application.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
'sphinx.transforms.post_transforms',
9090
'sphinx.transforms.post_transforms.code',
9191
'sphinx.transforms.post_transforms.images',
92-
'sphinx.util.compat',
9392
'sphinx.versioning',
9493
# collectors should be loaded by specific order
9594
'sphinx.environment.collectors.dependencies',

sphinx/builders/html/__init__.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ def prepare_writing(self, docnames: Set[str]) -> None:
548548
'rellinks': rellinks,
549549
'builder': self.name,
550550
'parents': [],
551-
'logo': logo,
552-
'favicon': favicon,
551+
'logo_url': logo,
552+
'favicon_url': favicon,
553553
'html5_doctype': not self.config.html4_writer,
554554
}
555555
if self.theme:
@@ -1227,18 +1227,14 @@ def setup_resource_paths(app: Sphinx, pagename: str, templatename: str,
12271227
pathto = context.get('pathto')
12281228

12291229
# favicon_url
1230-
favicon = context.get('favicon')
1231-
if favicon and not isurl(favicon):
1232-
context['favicon_url'] = pathto('_static/' + favicon, resource=True)
1233-
else:
1234-
context['favicon_url'] = favicon
1230+
favicon_url = context.get('favicon_url')
1231+
if favicon_url and not isurl(favicon_url):
1232+
context['favicon_url'] = pathto('_static/' + favicon_url, resource=True)
12351233

12361234
# logo_url
1237-
logo = context.get('logo')
1238-
if logo and not isurl(logo):
1239-
context['logo_url'] = pathto('_static/' + logo, resource=True)
1240-
else:
1241-
context['logo_url'] = logo
1235+
logo_url = context.get('logo_url')
1236+
if logo_url and not isurl(logo_url):
1237+
context['logo_url'] = pathto('_static/' + logo_url, resource=True)
12421238

12431239

12441240
def validate_math_renderer(app: Sphinx) -> None:

sphinx/domains/python.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -764,15 +764,11 @@ class PyMethod(PyObject):
764764
'async': directives.flag,
765765
'classmethod': directives.flag,
766766
'final': directives.flag,
767-
'property': directives.flag,
768767
'staticmethod': directives.flag,
769768
})
770769

771770
def needs_arglist(self) -> bool:
772-
if 'property' in self.options:
773-
return False
774-
else:
775-
return True
771+
return True
776772

777773
def get_signature_prefix(self, sig: str) -> List[nodes.Node]:
778774
prefix: List[nodes.Node] = []
@@ -788,9 +784,6 @@ def get_signature_prefix(self, sig: str) -> List[nodes.Node]:
788784
if 'classmethod' in self.options:
789785
prefix.append(nodes.Text('classmethod'))
790786
prefix.append(addnodes.desc_sig_space())
791-
if 'property' in self.options:
792-
prefix.append(nodes.Text('property'))
793-
prefix.append(addnodes.desc_sig_space())
794787
if 'staticmethod' in self.options:
795788
prefix.append(nodes.Text('static'))
796789
prefix.append(addnodes.desc_sig_space())
@@ -810,8 +803,6 @@ def get_index_text(self, modname: str, name_cls: Tuple[str, str]) -> str:
810803

811804
if 'classmethod' in self.options:
812805
return _('%s() (%s class method)') % (methname, clsname)
813-
elif 'property' in self.options:
814-
return _('%s (%s property)') % (methname, clsname)
815806
elif 'staticmethod' in self.options:
816807
return _('%s() (%s static method)') % (methname, clsname)
817808
else:

sphinx/util/compat.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/test_domain_py.py

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,8 @@ def test_pymethod_options(app):
731731
" .. py:method:: meth4\n"
732732
" :async:\n"
733733
" .. py:method:: meth5\n"
734-
" :property:\n"
735-
" .. py:method:: meth6\n"
736734
" :abstractmethod:\n"
737-
" .. py:method:: meth7\n"
735+
" .. py:method:: meth6\n"
738736
" :final:\n")
739737
domain = app.env.get_domain('py')
740738
doctree = restructuredtext.parse(app, text)
@@ -752,8 +750,6 @@ def test_pymethod_options(app):
752750
addnodes.index,
753751
desc,
754752
addnodes.index,
755-
desc,
756-
addnodes.index,
757753
desc)])]))
758754

759755
# method
@@ -795,35 +791,26 @@ def test_pymethod_options(app):
795791
assert 'Class.meth4' in domain.objects
796792
assert domain.objects['Class.meth4'] == ('index', 'Class.meth4', 'method', False)
797793

798-
# :property:
794+
# :abstractmethod:
799795
assert_node(doctree[1][1][8], addnodes.index,
800-
entries=[('single', 'meth5 (Class property)', 'Class.meth5', '', None)])
801-
assert_node(doctree[1][1][9], ([desc_signature, ([desc_annotation, ("property", desc_sig_space)],
802-
[desc_name, "meth5"])],
796+
entries=[('single', 'meth5() (Class method)', 'Class.meth5', '', None)])
797+
assert_node(doctree[1][1][9], ([desc_signature, ([desc_annotation, ("abstract", desc_sig_space)],
798+
[desc_name, "meth5"],
799+
[desc_parameterlist, ()])],
803800
[desc_content, ()]))
804801
assert 'Class.meth5' in domain.objects
805802
assert domain.objects['Class.meth5'] == ('index', 'Class.meth5', 'method', False)
806803

807-
# :abstractmethod:
804+
# :final:
808805
assert_node(doctree[1][1][10], addnodes.index,
809806
entries=[('single', 'meth6() (Class method)', 'Class.meth6', '', None)])
810-
assert_node(doctree[1][1][11], ([desc_signature, ([desc_annotation, ("abstract", desc_sig_space)],
807+
assert_node(doctree[1][1][11], ([desc_signature, ([desc_annotation, ("final", desc_sig_space)],
811808
[desc_name, "meth6"],
812809
[desc_parameterlist, ()])],
813810
[desc_content, ()]))
814811
assert 'Class.meth6' in domain.objects
815812
assert domain.objects['Class.meth6'] == ('index', 'Class.meth6', 'method', False)
816813

817-
# :final:
818-
assert_node(doctree[1][1][12], addnodes.index,
819-
entries=[('single', 'meth7() (Class method)', 'Class.meth7', '', None)])
820-
assert_node(doctree[1][1][13], ([desc_signature, ([desc_annotation, ("final", desc_sig_space)],
821-
[desc_name, "meth7"],
822-
[desc_parameterlist, ()])],
823-
[desc_content, ()]))
824-
assert 'Class.meth7' in domain.objects
825-
assert domain.objects['Class.meth7'] == ('index', 'Class.meth7', 'method', False)
826-
827814

828815
def test_pyclassmethod(app):
829816
text = (".. py:class:: Class\n"

0 commit comments

Comments
 (0)