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

Fix link to object if it is exposed in __all__ #670

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nathanthorpe
Copy link

Related issue #669

Search through the possible sources of the module when looking in all_modules.
Also use the path of the matched object.

…h all modules, use module name of the matched item
Copy link
Member

@mhils mhils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I generally agree that #669 is something we should support. 👍

That being said - we are reaching ugly levels of function complexity here, not sure yet how we can make things simpler. Worst case it just needs more docstrings. I will take a closer look when I have a few cycles. In the meantime, could you please 1) add a snapshot test and 2) a CHANGELOG entry? Thanks!

if target_exists_and_public:
assert doc is not None # mypy
# Check again if the object was re-exposed
for module, qualname in possible_sources(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should use qualname_candidates here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qualname is a string in this case, so I don't think it should be candidates

@nathanthorpe
Copy link
Author

Thanks for looking into it!
Ok I believe I've made the appropriate test case. Also added a changelog entry.

staceybellerose added a commit to staceybellerose/pdoc that referenced this pull request Apr 8, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants