Skip to content

Commit 0b3a140

Browse files
committed
Run Sphinx generation in Python 3.
Issue web-platform-tests#23081 This CL made the following changes: [1] Upgrading Sphinx version to 3.3.1 to support python 3.5+ [2] Fixing bugs invoked during Py3 run. a) Replace reference of "index" in checklist.md with relative path for index.md. This is due to "more than one target found for cross-reference" error thrown by Sphinx referring to it. It's a known issue in sphinx (sphinx-doc/sphinx#2549) b) Fix Sphinx in third_party/pywebsocket3. A PR has been sent at GoogleChromeLabs/pywebsocket3#16 Note: Command to run with Python3 is: wpt --py3 build-docs
1 parent 62b6255 commit 0b3a140

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

docs/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
('py:exc', 'BadOperationException'),
7979
('py:exc', 'Exception'),
8080
('py:exc', 'ValueError'),
81+
('py:class', 'integer -- return number of occurrences of value'),
82+
('py:class', 'integer -- return first index of value.'),
83+
('py:class', 'http.client.HTTPMessage')
8184
]
8285

8386
# The language for content autogenerated by Sphinx. Refer to documentation
@@ -211,5 +214,5 @@ def setup(app):
211214
# A list of files that should not be packed into the epub file.
212215
epub_exclude_files = ['search.html']
213216

214-
intersphinx_mapping = {'python': ('https://docs.python.org/2/', None),
217+
intersphinx_mapping = {'python': ('https://docs.python.org/3/', None),
215218
'mozilla': ('https://firefox-source-docs.mozilla.org/', None)}

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
recommonmark==0.6.0
22
# pin this to the last Py2 release
3-
Sphinx==1.8.5 # pyup: <2.0
3+
Sphinx==3.3.1 # pyup: <2.0
44
sphinx-argparse==0.2.5

docs/reviewing-tests/checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tests; in case of any contradiction with requirements stated elsewhere in the
55
documentation it should be ignored
66
(please [file a bug](https://github.com/web-platform-tests/wpt/issues/new)!).
77

8-
As noted on the [reviewing tests](index) page, nits need not block PRs
8+
As noted on the [reviewing tests](./index.md) page, nits need not block PRs
99
from landing.
1010

1111

docs/wpt_lint_rules.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from recommonmark.parser import CommonMarkParser
44
import importlib
55
import textwrap
6+
from six import iteritems
67

78
class WPTLintRules(Directive):
89
"""A docutils directive to generate documentation for the
@@ -31,7 +32,7 @@ def _get_rules(self):
3132
"""wpt-lint-rules: unable to resolve the module at "{}".""".format(self.module_specifier)
3233
)
3334

34-
for binding_name, value in module.__dict__.iteritems():
35+
for binding_name, value in iteritems(module.__dict__):
3536
if hasattr(value, "__abstractmethods__") and len(value.__abstractmethods__):
3637
continue
3738

tools/third_party/pywebsocket3/mod_pywebsocket/stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ def close_connection(self,
875875
wait_response: True when caller want to wait the response.
876876
Raises:
877877
BadOperationException: when reason is specified with code None
878-
or reason is not an instance of both str and unicode.
878+
or reason is not an instance of both str and unicode.
879879
"""
880880

881881
if self._request.server_terminated:

0 commit comments

Comments
 (0)