Merge "tox: Make everything work with Python 3"

This commit is contained in:
Zuul
2018-03-28 20:56:19 +00:00
committed by Gerrit Code Review
2 changed files with 13 additions and 3 deletions

View File

@@ -181,13 +181,26 @@ def monkey_patch_blockdiag():
text width rather than on word boundaries. There's a patch submitted to
resolve this [1]_ but it's unlikely to merge anytime soon.
In addition, blockdiag monkey patches a core library function,
``codecs.getreader`` [2]_, to work around some Python 3 issues. Because
this operates in the same environment as other code that uses this library,
it ends up causing issues elsewhere. We undo these destructive changes
pending a fix.
TODO: Remove this once blockdiag is bumped to 1.6, which will hopefully
include the fix.
.. [1] https://bitbucket.org/blockdiag/blockdiag/pull-requests/16/
.. [2] https://bitbucket.org/blockdiag/blockdiag/src/1.5.3/src/blockdiag/utils/compat.py # noqa
"""
import codecs
from codecs import getreader
from blockdiag.imagedraw import textfolder
# oh, blockdiag. Let's undo the mess you made.
codecs.getreader = getreader
def splitlabel(text):
"""Split text to lines as generator.

View File

@@ -138,9 +138,6 @@ deps =
commands = {posargs}
[testenv:docs]
# TODO(melwitt): This can be removed when the docs target can be run
# with python 3.x
basepython = python2.7
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/source/api doc/build api-guide/build api-ref/build placement-api-ref/build