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:
parent
3f08521d33
commit
b862f6ff35
|
@ -181,13 +181,26 @@ def monkey_patch_blockdiag():
|
||||||
text width rather than on word boundaries. There's a patch submitted to
|
text width rather than on word boundaries. There's a patch submitted to
|
||||||
resolve this [1]_ but it's unlikely to merge anytime soon.
|
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
|
TODO: Remove this once blockdiag is bumped to 1.6, which will hopefully
|
||||||
include the fix.
|
include the fix.
|
||||||
|
|
||||||
.. [1] https://bitbucket.org/blockdiag/blockdiag/pull-requests/16/
|
.. [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
|
from blockdiag.imagedraw import textfolder
|
||||||
|
|
||||||
|
# oh, blockdiag. Let's undo the mess you made.
|
||||||
|
codecs.getreader = getreader
|
||||||
|
|
||||||
def splitlabel(text):
|
def splitlabel(text):
|
||||||
"""Split text to lines as generator.
|
"""Split text to lines as generator.
|
||||||
|
|
||||||
|
|
3
tox.ini
3
tox.ini
|
@ -138,9 +138,6 @@ deps =
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:docs]
|
[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
|
deps = -r{toxinidir}/doc/requirements.txt
|
||||||
commands =
|
commands =
|
||||||
rm -rf doc/source/api doc/build api-guide/build api-ref/build placement-api-ref/build
|
rm -rf doc/source/api doc/build api-guide/build api-ref/build placement-api-ref/build
|
||||||
|
|
Loading…
Reference in New Issue