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

autodoc_default_options should accept True values #5459

Closed
jwodder opened this issue Sep 19, 2018 · 3 comments
Closed

autodoc_default_options should accept True values #5459

jwodder opened this issue Sep 19, 2018 · 3 comments

Comments

@jwodder
Copy link

jwodder commented Sep 19, 2018

Short version: Instead of this:

autodoc_default_options = {"members": None}

it would make more sense to be able to write this:

autodoc_default_options = {"members": True}

The new autodoc_default_options config option currently requires that its dict values be either strings or None, where None "means 'yes/true/on'". Seeing as None means True, it would make more sense to be able to actually write True instead (but keep None around for backwards compatibility).

Currently (in Sphinx 1.8), setting an autodoc_default_options value to True just produces an unhelpful error message:

Exception occurred:
  File "/Users/jwodder/work/GITHUB/headerparser/.tox/docs/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 82, in members_option
    return [x.strip() for x in arg.split(',')]
AttributeError: 'bool' object has no attribute 'split'
The full traceback has been saved in /var/folders/l7/wrkq93d133d8zpn36fmqrq0r0000gn/T/sphinx-err-dld5die4.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!
@tk0miya tk0miya added this to the 2.0.0 milestone Sep 20, 2018
tk0miya added a commit that referenced this issue Feb 11, 2019
…cepts_True

Closes #5459: autodoc: autodoc_default_options accepts True as a value
@tk0miya
Copy link
Member

tk0miya commented Feb 11, 2019

Fixed by #6053.
Thank you for your proposal!

@Borda
Copy link

Borda commented Feb 11, 2020

When it will be in a release?

@tk0miya
Copy link
Member

tk0miya commented Feb 11, 2020

It was already released as v2.0.0 in last April.

jcohenadad added a commit to ivadomed/ivadomed that referenced this issue May 31, 2020
hearot added a commit to hearot/pyrubrum that referenced this issue Jun 19, 2020
pld-gitsync pushed a commit to pld-linux/python-urwid that referenced this issue Jan 16, 2021
...in order to support syntax {"members": True}

sphinx-doc/sphinx#5459
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2021
dirkmunro89 added a commit to artofscience/SAOR that referenced this issue Jun 26, 2022
…ult_options. Seems to be a known issue, but should have been fixed sphinx-doc/sphinx#5459. Also added autodoc_mock_imports = [numba] to avoid numba not found warning when compiling. Not sure why this dependency issue, I guess, is there in the first place...
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

3 participants