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

Warning about unparseable C++ cross-reference when #499

Open
arwedus opened this issue Oct 30, 2024 · 0 comments
Open

Warning about unparseable C++ cross-reference when #499

arwedus opened this issue Oct 30, 2024 · 0 comments

Comments

@arwedus
Copy link

arwedus commented Oct 30, 2024

When I parse a function that's including a custom type based on enum.IntEnum with sphinx-autoapi,

I get this warning:

/workspace/docstring of converters.ros_streamer.VerbosityLevel:1: WARNING: Unparseable C++ cross-reference: 'enum.IntEnum'
Error in cross-reference.
If shorthand ref:
  Invalid C++ declaration: Expected identifier in nested name, got keyword: enum [error at 4]
    enum.IntEnum
    ----^
If full function ref:
  Error when parsing function declaration.
  If the function has no return type:
    Error in declarator or parameters-and-qualifiers
    Invalid C++ declaration: Expected identifier in nested name, got keyword: enum [error at 4]
      enum.IntEnum
      ----^
  If the function has a return type:
    Invalid C++ declaration: Expected identifier in nested name. [error at 4]
      enum.IntEnum
      ----^

The code looks like this:

.. autoapifunction:: converters.ros_converter.ros_to_hdf


.. autoapimodule:: converters.containers
   :members:
   :undoc-members:
# ros_converter.py
from containers import VerbosityLevel

def ros_to_hdf(
    bag,
    hdf_file=None,
    verbosity=VerbosityLevel.NONE,
    topics=None,
):
    pass
# containers.py
from enum import IntEnum

class VerbosityLevel(IntEnum):
    """Defines verbosity levels."""

    NONE = 0
    LOW = 1
    HIGH = 2
    DEBUG = 3

Version info

Python: 3.8
Sphinx: 7.1.2
sphinx-autoapi: 3.3.2

config

# conf.py

# I'm configuring autoapi_dirs to include the referenced code directory...

autoapi_generate_api_docs = False
autoapi_python_use_implicit_namespaces = True
autoapi_python_class_content = "both"
autodoc_typehints = "description"
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

No branches or pull requests

1 participant