Get dosctring without import

Joan Miller peloko45 at gmail.com
Fri Feb 26 08:02:53 EST 2010


On 26 feb, 12:35, Ben Finney <ben+pyt... at benfinney.id.au> wrote:
> Joan Miller <pelok... at gmail.com> writes:
> > I use a function in 'setupy.py' to get automatically the description
> > from the package's docstring, but there is a problem when you import a
> > module that has to be built by cython (because it tries load a module
> > that doesn't exists).
>
> A simple approach (at least, simpler than crawling a parse tree) might
> be to store the package description in a separate non-executable file.
>
> A common convention is to have a ‘README’ text file, written in
> reStructuredText for rendering to various output formats as part of the
> documentation. You could then have the ‘setup.py’ program read the
> contents of that file and use it (or a slice of it) for the package
> description.
I get the 'README.txt' file to get the long description but I use the
docstring because each package should include a short desciption about
it.



More information about the Python-list mailing list