__init__.py not handled correctly
Brought to you by:
doughellmann,
krlosaqp
Apparently happydoc is not handling packages
correctly. It included __init__.py as a sub-module,
when in fact it is the contents of the module. I think
that the contents of __init__.py should be documented
at the same level as the directory.
From "happydoc --help" I get the impression that I can
get this behaviour by specifying "-T usePackages" or
perhaps "-T usePackages=true", but both give me an
error message stating that the only valid -T options
are 'singlefile', 'dia', 'multifile_docset', and
'stdout'. So perhaps this is really a bug in the help
text :-)
Logged In: YES
user_id=34486
The -T option is used to select the docset type. Each docset type supports
different named options which do not use the dashes. So, the syntax
error is correct. You could specify "usePackages=true" without the -T
or you could specify "-T SingleFile usePackages=true". Actually, the
default is usePackages=true so you don't need to specify either.
I
made the decision to list __init__.py as a submodule because there may
be other submodules. It also made the docset processing code a little
simpler as I don't have to check the difference between a package and a
module at the point of recursion. Frequently the "contents" of the
__init__.py are imported from another file anyway, so HappyDoc won't
generate the output you desire.
In short, you're seeing the expected
behavior. It would be possible to construct a different docset
implementation that would work differently, but the design of the
documentation itself could be problematic -- how do you handle the case
where the __init__ provides access to the symbols, but is not the source
of their implementation?
Doug