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

AttributeError: 'Sphinx' object has no attribute 'add_description_unit' (pytest pytest-4.3.1.dev110+g51bf7c3a, sphinx 2.0.0b1) #6174

Closed
hroncok opened this issue Mar 12, 2019 · 5 comments

Comments

@hroncok
Copy link
Contributor

hroncok commented Mar 12, 2019

Describe the bug
pytest documentation cannot be built.

See pytest-dev/pytest#4912

To Reproduce

[tmp]$ git clone https://github.com/pytest-dev/pytest.git
...
[tmp]$ cd pytest
[tmp]$ git rev-parse HEAD
51bf7c3aef8f018f44e7c36378be894aa13e32b5
[pytest (master)]$ python3.7 -m venv __venv__
[pytest (master)]$ . __venv__/bin/activate
(__venv__) [pytest (master)]$ pip install --pre sphinx
...
Successfully installed Jinja2-2.10 MarkupSafe-1.1.1 Pygments-2.3.1 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 packaging-19.0 pyparsing-2.3.1 pytz-2018.9 requests-2.21.0 six-1.12.0 snowballstemmer-1.2.1 sphinx-2.0.0b1 sphinxcontrib-applehelp-1.0.1 sphinxcontrib-devhelp-1.0.1 sphinxcontrib-htmlhelp-1.0.1 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.2 sphinxcontrib-serializinghtml-1.1.1 urllib3-1.24.1
(__venv__) [pytest (master)]$ cd doc/en
(__venv__) [en (master)]$ pip install -r requirements.txt
...
Successfully installed pygments-pytest-1.2.0 sphinx-removed-in-0.1.3 sphinxcontrib-trio-1.0.2
(__venv__) [en (master)]$ pip install ../..
...
Successfully installed atomicwrites-1.3.0 attrs-19.1.0 more-itertools-6.0.0 pluggy-0.9.0 py-1.8.0 pytest-4.3.1.dev110+g51bf7c3a
(__venv__) [en (master)]$ sphinx-build -W -b html . _build
Running Sphinx v2.0.0b1
making output directory... done

Exception occurred:
  File "/home/churchyard/tmp/pytest/doc/en/conf.py", line 338, in setup
    app.add_description_unit(
AttributeError: 'Sphinx' object has no attribute 'add_description_unit'
The full traceback has been saved in /tmp/sphinx-err-k3n0s9df.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!
(__venv__) [en (master)]$ cat /tmp/sphinx-err-k3n0s9df.log
# Sphinx version: 2.0.0b1
# Python version: 3.7.2 (CPython)
# Docutils version: 0.14 
# Jinja2 version: 2.10
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/home/churchyard/tmp/pytest/__venv__/lib64/python3.7/site-packages/sphinx/cmd/build.py", line 283, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/home/churchyard/tmp/pytest/__venv__/lib64/python3.7/site-packages/sphinx/application.py", line 242, in __init__
    self.config.setup(self)
  File "/home/churchyard/tmp/pytest/doc/en/conf.py", line 338, in setup
    app.add_description_unit(
AttributeError: 'Sphinx' object has no attribute 'add_description_unit'

Expected behavior
Build the docs.

Your project
https://github.com/pytest-dev/pytest

Environment info

  • OS: Linux (Fedora 29 to 31)
  • Python version: 3.7.2
  • Sphinx version: 2.0.0b1
  • Sphinx extensions: default
@hroncok
Copy link
Contributor Author

hroncok commented Mar 12, 2019

This was apparently deprecated. Sorry about the noise.

@hroncok hroncok closed this as completed Mar 12, 2019
@hroncok
Copy link
Contributor Author

hroncok commented Mar 12, 2019

Actually, this is still documented:

This method is also available under the deprecated alias
:meth:`add_description_unit`.

@hroncok hroncok reopened this Mar 12, 2019
@hroncok
Copy link
Contributor Author

hroncok commented Mar 12, 2019

Should this sentence be removed from the docstring?

@tk0miya
Copy link
Member

tk0miya commented Mar 13, 2019

Oh, yes. You're right. It should be removed.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Mar 13, 2019
@tk0miya tk0miya added this to the 2.0.0 milestone Mar 13, 2019
tk0miya added a commit that referenced this issue Mar 14, 2019
docs: drop mention to deprecated method (refs: #6174)
@tk0miya
Copy link
Member

tk0miya commented Mar 14, 2019

Closing this now.
Thank you for reporting :-)

@tk0miya tk0miya closed this as completed Mar 14, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants