distutils (packaging) newbie questions please....

Greg Krohn ask at me.com
Tue Sep 30 19:57:57 EDT 2003


"Christian Seberino" <seberino at spawar.navy.mil> wrote in message
news:bf23f78f.0309301511.376225b0 at posting.google.com...
> I really want to learn distutils to professionally package some open
> source software.
>
> I had some distutils questions after reading python.org distutil docs
> on packaging code
> if you don't mind.  I would really appreciate some help.....

I've never used distutil, so I can onlt help a little bit here.

> 1. What exactly goes into the __init__.py files? I know what to put in
> setup.py
>     and I know __init__.py is used for packages but I don't know what
> to put IN this file.

You don't NEED to put anything in it, it works fine as an empty file. You
CAN put code in there to initialize your package, but personally I've never
had to.

> 2. About the data_files option for setup.py....
>
>       data_files = [ "<installation directory>", [ "<file1>",
> "<file2>", ...] ]
>
>    Is there a way to AVOID having to type EVERY single data file?? Can
> I specify
>    just the directory or use wild cards??

Sure, it's just a list of filenames. You can use glob.glob('*.dat') like
this:

data_files = = ['./images', glob.glob('*.png')]


Hopefully someone else can help you with the rest.


greg






More information about the Python-list mailing list