tox: Make everything work with Python 3

Nothing too fancy here except that we've to work around a really ugly
side-effect of blockdiag.

Change-Id: Ibd32d30aacae65702d0ccbdb8a02b1667ec4e8ee
This commit is contained in:
Stephen Finucane 2018-03-27 16:16:49 +01:00
parent 3f08521d33
commit b862f6ff35
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