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

Source link for renamed module disappears #55

Open
hunse opened this issue Apr 7, 2020 · 1 comment
Open

Source link for renamed module disappears #55

hunse opened this issue Apr 7, 2020 · 1 comment

Comments

@hunse
Copy link
Collaborator

hunse commented Apr 7, 2020

With nengo_sphinx_theme.ext.renamed_autoautosummary, the [source] links for nengo_sphinx_theme.ext.renamed_autoautosummary.a_test_function and nengo_sphinx_theme.ext.renamed_autoautosummary.TestClass do not appear.

This is related to the following error that appears in the docs build output for this repo:

Traceback (most recent call last):
  File "/home/eric/venv/full3/lib/python3.6/site-packages/sphinx/ext/viewcode.py", line 35, in _get_full_modname
    return get_full_modname(modname, attribute)
  File "/home/eric/venv/full3/lib/python3.6/site-packages/sphinx/util/__init__.py", line 331, in get_full_modname
    module = import_module(modname)
  File "/home/eric/venv/full3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'nengo_sphinx_theme.ext.renamed_autoautosummary'
viewcode can't import nengo_sphinx_theme.ext.renamed_autoautosummary, failed with error "No module named 'nengo_sphinx_theme.ext.renamed_autoautosummary'"

This does not appear to be a problem e.g. in the Nengo docs, when we rename classes like nengo.neurons.LIF to nengo.LIF. The difference could be that there we're renaming a single class, whereas here we're renaming a module.

@tbekolay
Copy link
Member

We looked into this a bit, and indeed the issue is renaming modules. The ability to rename modules still makes sense, but in this case it fails because you can't actually import the renamed module.

The resolution to this issue therefore doesn't seem like we should make it possible, but we should raise an explicit error here because it's not something we want people to do accidentally. Then we should change the example we render in the docs.

However, since the resolution doesn't change behaviour, we're probably not going to put in any cycles to this any time soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants