Add compatibility with Python 3.x.
Review Request #9741 — Created March 5, 2018 and submitted
This adds compatibility for building docs on both Python 2.7 and 3.x
releases. For the most part, we were in good shape to support both, but
we had a few things we were doing wrong.The primary issue was that we were explicitly using bytestrings for
configuration items and signal connections for Sphinx. This used to be a
requirement, but it isn't anymore (except foradd_crossref_type()
,
which needs native strings). We now use Unicode strings everywhere.In a few places, we were calling legacy
iter*
functions on dictionaries.
Those have been updated to usesix.iter*
instead.The GitHub support was working with byte data coming from a process's
output, which needed to be decoded to a Unicode string.There was also a legacy import (
sphinx.util.compat.Directive
), which we
needed to update.Sphinx 1.7.1 and six are now requirements for the package, ensuring
we have what we need to build, and classifiers were added advertising
the Python version support.
Built a few doc packages using Python 2.7, 3.4, 3.5, and 3.6.
There may still be some lines of code that weren't tested thoroughly,
but the main use cases worked. Also verified that Python 3.x could
import all the modules without errors.
- Change Summary:
-
- Fixed the version specifiers to list 3.6 and not 3.3.
- Moved
six
to the correct import group.
- Commit:
-
7b7f013c988c7bae62dd826a01fbcfb2596bb66616619d3a6e9de4e92835f47ade27b975aa5cbdd9
- Diff:
-
Revision 2 (+30 -18)