Skip to content

BUG backreferences not working for functions if not imported directly #583

@lucyleeow

Description

@lucyleeow

Creation of mini-galleries with backreferences_dir and doc_module generates an empty rst file if you use a function in an example like this:

import package.module

package.module.my_fun()

It works if you directly import the function in the example:

from package.module import my_fun

my_fun()

or if you import the function in the __init__.py file of the package (i.e.:

from .module import (
    my_fun,
    )

Note that this is only for functions. Classes work fine in all cases.

Refer to sphinx-gallery/sample-project#1 (comment) for suggestion on how to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions