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

Ability to get documentation without importing code #82

Closed
ericholscher opened this issue Dec 11, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@ericholscher
Copy link

commented Dec 11, 2015

It sounds like a good bit of the infrastructure is already there for getting docs out of python code without importing it. Would it be possible to have this exposed, so that you could get (perhaps more limited) documentation from a file, without requiring it (and all its dependencies) to be importable?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2015

It sounds like a good bit of the infrastructure is already there for getting docs out of python code without importing it.

Could you explain a bit more what you mean by this? pdoc is irrevocably tied to its ability to import the module it is trying to document. Except for reading documentation on variables (which traverses the AST), everything else is done by runtime inspection, which is only possible when the module is imported.

I agree that a tool that generates documentation by only inspecting the AST (without ever importing the module) is useful. However, that tool is not nor will ever be pdoc. (Do any such tools exist for Python? Last time I checked, both Sphinx and epydoc relied on importing the module. Although, perhaps I missed a feature that allowed one to skirt around that requirement.)

@ericholscher

This comment has been minimized.

Copy link
Author

commented Dec 14, 2015

Ah, okay. I just read something along those lines in the docs, and was hopeful. I keep hoping to find something that doesn't import code to be able to generate docs, but it sounds like pdoc isn't it. Thanks for the reply.

epydoc has a mode where it will do parse-only docs, but as you know, it hasn't been touched in the last ~5 years, and has no py3 support :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.