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: module 'sphinx.domains.c' has no attribute 'CMacroObject' #495

Closed
jedbrown opened this issue Apr 8, 2020 · 3 comments
Closed
Assignees
Labels
support Not actual issues, but help

Comments

@jedbrown
Copy link

jedbrown commented Apr 8, 2020

This just showed up on upgrade to v4.15.0; cf. cee5cd1

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 275, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 245, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 397, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 465, in load_extension
    metadata = setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/breathe/__init__.py", line 13, in setup
    from . import directives
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/breathe/directives.py", line 4, in <module>
    from .renderer import DoxygenToRstRendererFactory
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/breathe/renderer/__init__.py", line 5, in <module>
    from . import sphinxrenderer
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/breathe/renderer/sphinxrenderer.py", line 74, in <module>
    class DomainDirectiveFactory(object):
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/breathe/renderer/sphinxrenderer.py", line 90, in DomainDirectiveFactory
    'define': (c.CMacroObject, 'macro'),
AttributeError: module 'sphinx.domains.c' has no attribute 'CMacroObject'

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/libceed/envs/latest/lib/python3.7/site-packages/breathe/renderer/sphinxrenderer.py", line 90, in DomainDirectiveFactory
    'define': (c.CMacroObject, 'macro'),
AttributeError: module 'sphinx.domains.c' has no attribute 'CMacroObject'
jedbrown added a commit to CEED/libCEED that referenced this issue Apr 8, 2020
Workaround breathe-doc/breathe#495

Reported-by: Jeremy L. Thompson <jeremy.thompson@colorado.edu>
@vermeeren vermeeren self-assigned this Apr 8, 2020
@vermeeren vermeeren added the support Not actual issues, but help label Apr 8, 2020
@vermeeren
Copy link
Collaborator

Breathe >= 4.15.0 explicitly requires Sphinx >= 3.0, as can be seen in https://github.com/michaeljones/breathe/blob/v4.15.0/setup.py#L18. I suppose you are force-installing things somehow and/or are ignoring dependency versions. Sphinx 3.0.0 definitely has CMacroObject.

@jedbrown
Copy link
Author

jedbrown commented Apr 8, 2020

Thanks. I expect other people will encounter this on ReadTheDocs where the default Sphinx is even older. Our requirements.txt only had sphinx==2.4.4 and no version restriction on Breathe.

@vermeeren
Copy link
Collaborator

Thing is it should refuse to install in such a case, as the dependency cannot be satisfied, for example on microsoft/LightGBM#2982 the resulting error is:

ERROR: breathe 4.15.0 has requirement Sphinx>=3.0, but you'll have sphinx 2.4.4 which is incompatible.

I expect pip and others to handle this in a similar fashion unless dependencies are ignored, either pulling in an old version of Breathe when Sphinx is pinned to 2.x or giving a proper dependency error. It could be some tools used to manage packages do not check dependencies though.

ax3l added a commit to openPMD/openPMD-api that referenced this issue Apr 8, 2020
See
  breathe-doc/breathe#495
  breathe-doc/breathe#496

RTD does not yet provide Sphinx 3.0
ax3l added a commit to ax3l/picongpu that referenced this issue Apr 8, 2020
RTD does not yet provide Sphinx 3 but Breathe 4.15.0+
requires Sphinx 3.

Ref.: breathe-doc/breathe#495
ax3l added a commit to ax3l/WarpX that referenced this issue Apr 8, 2020
RTD does not yet provide Sphinx 3 but the Breathe extension
in version 4.15.0+ requires Sphinx 3.

Ref.: breathe-doc/breathe#495
psychocoderHPC pushed a commit to psychocoderHPC/picongpu that referenced this issue Apr 9, 2020
RTD does not yet provide Sphinx 3 but Breathe 4.15.0+
requires Sphinx 3.

Ref.: breathe-doc/breathe#495
MaxThevenet pushed a commit to ECP-WarpX/WarpX that referenced this issue Apr 9, 2020
RTD does not yet provide Sphinx 3 but the Breathe extension
in version 4.15.0+ requires Sphinx 3.

Ref.: breathe-doc/breathe#495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Not actual issues, but help
Projects
None yet
Development

No branches or pull requests

2 participants