twisted / pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
https://pydoctor.readthedocs.io
Other
184 stars 49 forks source link

need a saner way to declare the mapping between filesystem paths and Python module/package names #8

Open mwhudson opened 9 years ago

mwhudson commented 9 years ago

As it stands, it's a real pain to get pydoctor to document, e.g., bzr plugins, due to it's strong preconcieved notions about how to go from realpath() to Python package/module name, with the "prependedpackage" thing sorta tacked on...


Imported from Launchpad using lp2gh.

mwhudson commented 9 years ago

(by mwhudson) I can see the problem (it will also affect a project that uses buildout).

I'm less clear on a solution though :/

mwhudson commented 9 years ago

(by naesten) I was thinking something like

--(module|package)=[python.module.name:]/path/to/file/or/directory

where, if omitted, the python.module.name would be assumed to be just "directory" in this case. If you passed a filename ending in .py, it would be just the basename of that. (It wouldn't really matter whether what you passed was a module filename or a package directory name.)

I've not got my heart set on this exact syntax, but it seems like it wouldn't be too hard...

The config file bit, I'm not too sure about. I guess a variable that you set to a comma-seperated list of these would be the obvious approach ... I'd try to implement it myself, but the code scares me :-(.

mwhudson commented 9 years ago

(by mwhudson) Samuel Bronson wrote:

I was thinking something like

--(module|package)=[python.module.name:]/path/to/file/or/directory

where, if omitted, the python.module.name would be assumed to be just "directory" in this case. If you passed a filename ending in .py, it would be just the basename of that. (It wouldn't really matter whether what you passed was a module filename or a package directory name.)

Actually, I've come to think that the --module options are silly; they're arguments really.

pydoctor bzrlib.plugins.svn:~/.bazaar/plugins/svn ~/src/bzr.dev/bzrlib

doesn't seem too bad.

I've not got my heart set on this exact syntax, but it seems like it wouldn't be too hard...

The config file bit, I'm not too sure about. I guess a variable that you set to a comma-seperated list of these would be the obvious approach ... I'd try to implement it myself, but the code scares me :-(.

It scares me a bit these days too :( If you wanted to rip it out and use configlue or something instead, I'd be very happy with that.

Cheers, mwh

mwhudson commented 9 years ago

(by naesten) On Tue, Aug 4, 2009 at 9:46 PM, Michael Hudson

Samuel Bronson wrote:

Actually, I've come to think that the --module options are silly; they're arguments really.

pydoctor bzrlib.plugins.svn:~/.bazaar/plugins/svn ~/src/bzr.dev/bzrlib

doesn't seem too bad.

Yeah, that's even better.

The config file bit, I'm not too sure about. I guess a variable that you set to a comma-seperated list of these would be the obvious approach ... I'd try to implement it myself, but the code scares me :-(.

It scares me a bit these days too :(  If you wanted to rip it out and use configlue or something instead, I'd be very happy with that.

I'm not familiar with that, and ripping large pieces out of other people's code isn't my cup of tea...