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

Close #4257: autodoc: Add autodoc_class_signature #9171

Merged
merged 1 commit into from May 15, 2021

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented May 5, 2021

Feature or Bugfix

  • Feature

Purpose

@tk0miya tk0miya added type:enhancement enhance or introduce a new feature extensions:autodoc labels May 5, 2021
@tk0miya tk0miya added this to the 4.1.0 milestone May 5, 2021
doc/usage/extensions/autodoc.rst Outdated Show resolved Hide resolved
doc/usage/extensions/autodoc.rst Outdated Show resolved Hide resolved
doc/usage/extensions/autodoc.rst Outdated Show resolved Hide resolved
sphinx/ext/autodoc/__init__.py Show resolved Hide resolved
@tk0miya tk0miya force-pushed the 4257_autodoc_class_signature branch 3 times, most recently from fb3f3e0 to 59b2830 Compare May 6, 2021 15:12
@tk0miya tk0miya force-pushed the 4257_autodoc_class_signature branch 3 times, most recently from db60c7b to 7f16b82 Compare May 15, 2021 16:48
Add `autodoc_class_signature` to separate the class entry and the
definition of `__init__()` method.
@tk0miya tk0miya force-pushed the 4257_autodoc_class_signature branch from 7f16b82 to 51ae283 Compare May 15, 2021 16:53
@tk0miya tk0miya merged commit 99f4672 into sphinx-doc:4.x May 15, 2021
@tk0miya tk0miya deleted the 4257_autodoc_class_signature branch May 15, 2021 17:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2021
if self.options.special_members is None:
self.options['special-members'] = {'__new__', '__init__'}
else:
self.options.special_members.append('__new__')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean .add instead of .append here and in class _All? I tried to build my project documentation with the new autodoc_class_signature option (sphinx installed from github master) and got

# ... snip ...
  File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/directive.py", line 162, in run
    documenter.generate(more_content=self.content)
  File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 976, in generate
    self.document_members(all_members)
  File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 850, in document_members
    documenter = classes[-1](self.directive, full_mname, self.indent)
  File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 1452, in __init__
    self.options.special_members.append('__new__')
AttributeError: 'set' object has no attribute 'append'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops... you're right. Could you file an issue or pull request, please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions:autodoc type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants