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

Support autodoc_mock_imports #35

Merged
merged 3 commits into from
Jul 15, 2024
Merged

Conversation

prajeeshag
Copy link

Sphinx autodoc_mock_imports is implemented here.
#9 (comment)

Copy link
Collaborator

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Please add some unit tests for this.

sphinxarg/ext.py Outdated
@@ -10,6 +10,8 @@
from docutils.statemachine import StringList
from docutils.utils import new_document
from sphinx.util.nodes import nested_parse_with_titles
from sphinx.ext.autodoc import mock
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this import ever fail? I forget if autodoc is shipped with Sphinx or an extra module that needs to be installed.

@AA-Turner AA-Turner changed the title Sphinx autodoc mock_imports added Support autodoc_mock_imports Jul 15, 2024
@AA-Turner AA-Turner merged commit fc253ed into sphinx-doc:main Jul 15, 2024
7 checks passed
@mark-nicholson
Copy link

Something is awry with this commit. I get a crash at that first line. version 0.4.0 work like a champ for a long time.

  File "/u02/masatest/mjnichol-3.6.1.dev1-bscrub-311/venv/lib64/python3.11/site-packages/sphinxarg/ext.py", line 509, in run
    with mock(self.config.autodoc_mock_imports):
              ^^^^^^^^^^^
AttributeError: 'ArgParseDirective' object has no attribute 'config'

@AA-Turner
Copy link
Member

Fixed in 11bfc2b; sorry. See also #56.

A

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 this pull request may close these issues.

4 participants