Skip to content

Commit da46f68

Browse files
ziransunHexcles
andauthored
Run Sphinx generation in Python 3. (#26574)
Fixes #23081 This CL made the following changes: [1] Upgrading Sphinx version to 2.4.4 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 Co-authored-by: Robert Ma <[email protected]>
1 parent 5d39fdb commit da46f68

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
('py:exc', 'BadOperationException'),
7979
('py:exc', 'Exception'),
8080
('py:exc', 'ValueError'),
81+
('py:class', 'http.client.HTTPMessage')
8182
]
8283

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

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

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
recommonmark==0.6.0
2-
# pin this to the last Py2 release
3-
Sphinx==1.8.5 # pyup: <2.0
2+
# Pin this to the same major version as https://docs.python.org/3/
3+
Sphinx==2.4.4 # pyup: <3.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/docker/documentation/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM python:2-stretch
1+
FROM python:3.8-buster
22

3-
RUN apt-get update && apt-get install --yes git
3+
RUN apt-get update && apt-get install --yes git virtualenv

0 commit comments

Comments
 (0)