Is distutils for me?

Kirk Strauser kirk at strauser.com
Tue Oct 21 16:10:07 EDT 2003


I'm preparing to release a new version of some software I've written.  It
looks like using distutils and setup.py would be a very handy way to provide
an installer for end-users, but I've never used it before and I'm confused
about a few things.

First, a little about my program.  It's divided into a few discrete parts:

  1) A package containing the core functionality of the system:

    Newtrino/Blackhole.py
    Newtrino/MD5.py
    Newtrino/__init__.py
    Newtrino/conversion.py
    Newtrino/DNS/NSUpdate.py
    Newtrino/DNS/__init__.py
    Newtrino/Storage/PostgreSQL.py
    Newtrino/Storage/__init__.py

  2) A configuration file:

    config-sample.py

  3) Command-line utilities that use all of the above:

    newtrino.py
    wormhole.py

The distutils documentation is pretty clear on how to write a setup.py that
will install the core package into the user's sys.path.  However, I also
want to install the command-line utilities somewhere into their $PATH, and
put the config file into either /usr/local/etc or /etc.

My main questions are:

How can I write a setup() function that creates a distribution archive with
both of #1 and #3 above instead of one archive for #1 and another for #3?

Assuming there's a pre-build way of installing #2 into an appropriate
directory, what's the Python-esque way of making the installer tell #1 where
it's located?  Or do I need to write a separate Configuration.py module that
does something like:

   for directory in ['/usr/local/etc', '/etc/newtrino', '/etc']:
       configfile = '%s/config-file.conf' % directory
       if configfile exists:
           load it

I appreciate any pointers - I really want to make a distribution that's as
easy as possible for end-users to install.
-- 
Kirk Strauser
The Strauser Group
Open. Solutions. Simple.
http://www.strausergroup.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20031021/b3f8aa13/attachment.sig>


More information about the Python-list mailing list