plone / papyrus

A buildout to run multiple versions of the plone documentation
GNU General Public License v2.0
8 stars 7 forks source link

Upgrading Sphinx to 1.4.8 docs building is failing #117

Closed svx closed 7 years ago

svx commented 7 years ago

I am trying to update sphinx and this is failing with the following message:

File "/home/svx/Projects/plone/papyrus/eggs/Sphinx-1.4.8-py2.7.egg/sphinx/environment.py", line 947, in process_images
    type='image', subtype='nonlocal_uri')
TypeError: _warn_node() got an unexpected keyword argument 'type'

Below the full output

svx at beaker in ~/.../plone/papyrus on 5.0 [!]
$ make html
LANGUAGE=en bin/sphinx-build -b html -w log/sphinx-build.log -D language=en -D sphinxcontrib_robotframework_enabled=0 -d build/doctrees -c conf   source/documentation build/html/en
Running Sphinx v1.4.8
Initializing Spelling Checker
loading translations [en]... done
WARNING: The config value `version' has type `list', defaults to `str.'
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 633 source files that are out of date
updating environment: 633 added, 0 changed, 0 removed
reading sources... [ 10%] develop/addons/bobtemplates.plone/README                                                                                                                                                                                   
Exception occurred:
  File "/home/svx/Projects/plone/papyrus/eggs/Sphinx-1.4.8-py2.7.egg/sphinx/environment.py", line 947, in process_images
    type='image', subtype='nonlocal_uri')
TypeError: _warn_node() got an unexpected keyword argument 'type'
The full traceback has been saved in /tmp/sphinx-err-uYCO2k.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:79: recipe for target 'html-en' failed
make: *** [html-en] Error 1

buildout:

Sphinx = 1.4.8
six = 1.10.0
Pygments = 2.1.3

# robot-support requires the newest versions:
docutils = 0.12

# latest urllib3 1.18 fails to install on Travis, due to
# 'secure:python_version <= "2.7"' in its setup.py
# 1.19 should be fine once it is released.
urllib3 = 1.17

plone.app.robotframework = 0.9.16
robotframework = 3.0
robotframework-selenium2library = 1.8.0[>1;4403;0c
robotframework-selenium2screenshots = 0.7.2
robotsuite = 1.7.0
selenium = 3.0.1
sphinxcontrib-robotframework = 0.6.1
svx commented 7 years ago

This can be fixed by removing the old warn method and use supress instead:

# -- General configuration ----------------------------------------------------

# 'monkey patch' sphinx to omit 'nonlocal image URI found' warnings
#import sphinx.environment
#from docutils.utils import get_source_line

#def _warn_node(self, msg, node):
#    if not msg.startswith('nonlocal image URI found:'):
#        self._warnfunc(msg, '%s:%s' % get_source_line(node))

#sphinx.environment.BuildEnvironment.warn_node = _warn_node

supress_warnings = ["nonlocal"]

The question is do we need that warning at all ?

svx commented 7 years ago

In the meantime, sphinx 1.5 is out

svx commented 7 years ago

Closing this, we are way behind of Sphnix versions anyway, still good to have this under closed issues, anyway :)