readthedocs / readthedocs/sphinx-autoapi
Indirect imports not supported
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 494
- Forks
- 147
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
If you import something in multiple steps you get an error like "WARNING: Cannot resolve import of $BLAH in $BAR [autoapi.python_import_resolution]". More specifically I'm refering to a scenario like this:
mypack.mod1:
from pathlib import Path
mypack.mod2:
from .mod1 import Path
This is arguably a bad practice and some linters complain about it but it would be nice if it worked.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation and tests for the autoapi.python_import_resolution warning, then trace how imports are resolved across modules. Reproduce the mypack.mod1 and mypack.mod2 example and update the relevant behavior so the indirect Path import resolves without the warning; add or adjust a regression test if that area has coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100