Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx 2.0 problems: BuildEnvironment has no attribute warn_node #6

Closed
hroncok opened this issue May 13, 2019 · 1 comment · Fixed by #7
Closed

Sphinx 2.0 problems: BuildEnvironment has no attribute warn_node #6

hroncok opened this issue May 13, 2019 · 1 comment · Fixed by #7

Comments

@hroncok
Copy link
Contributor

hroncok commented May 13, 2019

In Fedora, we have the following problem when building the docs with Sphinx 2.0.1:

+ sphinx-build docs html
Running Sphinx v2.0.1
BUILDSTDERR: Configuration error:
BUILDSTDERR: There is a programmable error in your configuration file:
BUILDSTDERR: Traceback (most recent call last):
BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/sphinx/config.py", line 361, in eval_config_file
BUILDSTDERR:     execfile_(filename, namespace)
BUILDSTDERR:   File "/usr/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 86, in execfile_
BUILDSTDERR:     exec(code, _globals)
BUILDSTDERR:   File "/builddir/build/BUILD/python-utils-2.3.0/docs/conf.py", line 71, in <module>
BUILDSTDERR:     original_warn_mode = sphinx.environment.BuildEnvironment.warn_node
BUILDSTDERR: AttributeError: type object 'BuildEnvironment' has no attribute 'warn_node'

I cannot have a look ATM, but can try to submit a PR later.

Reported at https://bugzilla.redhat.com/show_bug.cgi?id=1709063

@hroncok
Copy link
Contributor Author

hroncok commented May 13, 2019

You apparently build docs by Python 2.7. That is essentially workarounding this, as it fetches Sphinx < 2. However when I adapt tox.ini like this:

diff --git a/tox.ini b/tox.ini
index 33b165c..7b51295 100644
--- a/tox.ini
+++ b/tox.ini
@@ -19,7 +19,7 @@ deps = flake8
commands = flake8 --ignore=W391 python_utils {posargs}

[testenv:docs]
-basepython = python2.7
+basepython = python3.7
whitelist_externals =
    rm
    cd

I can reproduce:

$ tox -e docs
GLOB sdist-make: .../python-utils/setup.py
docs inst-nodeps: .../python-utils/.tox/.tmp/package/1/python-utils-2.3.0.zip
docs installed: alabaster==0.7.12,Babel==2.6.0,certifi==2019.3.9,chardet==3.0.4,docutils==0.14,idna==2.8,imagesize==1.1.0,Jinja2==2.10.1,MarkupSafe==1.1.1,mock==3.0.5,packaging==19.0,Pygments==2.4.0,pyparsing==2.4.0,python-utils==2.3.0,pytz==2019.1,requests==2.21.0,six==1.12.0,snowballstemmer==1.2.1,Sphinx==2.0.1,sphinxcontrib-applehelp==1.0.1,sphinxcontrib-devhelp==1.0.1,sphinxcontrib-htmlhelp==1.0.2,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.2,sphinxcontrib-serializinghtml==1.1.3,urllib3==1.24.3
docs run-test-pre: PYTHONHASHSEED='4126083665'
docs runtests: commands[0] | rm -f docs/project_name.rst
docs runtests: commands[1] | rm -f docs/modules.rst
docs runtests: commands[2] | mkdir -p docs/_static
docs runtests: commands[3] | sphinx-apidoc -o docs/ python_utils
File docs/python_utils.rst already exists, skipping.
Creating file docs/modules.rst.
docs runtests: commands[4] | rm -f docs/modules.rst
docs runtests: commands[5] | sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
Running Sphinx v2.0.1

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File ".../python-utils/.tox/docs/lib/python3.7/site-packages/sphinx/config.py", line 361, in eval_config_file
    execfile_(filename, namespace)
  File ".../python-utils/.tox/docs/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 86, in execfile_
    exec(code, _globals)
  File ".../python-utils/docs/conf.py", line 71, in <module>
    original_warn_mode = sphinx.environment.BuildEnvironment.warn_node
AttributeError: type object 'BuildEnvironment' has no attribute 'warn_node'

ERROR: InvocationError for command '.../python-utils/.tox/docs/bin/sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html' (exited with code 2)
___________________________________ summary ____________________________________
ERROR:   docs: commands failed

hroncok added a commit to hroncok/python-utils that referenced this issue May 13, 2019
@wolph wolph closed this as completed in #7 May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant