[Distutils] Re: Newbie needs (begs for) help (fwd)

Greg Ward gpward@starpower.net
Sat Oct 28 09:52:02 2000

On 22 October 2000, James Thompson said:
> I hate to bother you personally but the list is screwed and I'm pushing
> for a new release for our app w/ distutil support today.  

Bad luck!  Due to the Starship outage, your mail to me sat in limbo for
almost a week.  Dunno what's up with the Distutils list... 

> I have an application that is partially modules, a few packages, and a
> final application or two.
> I'd like the application to end up in equiv of autoconfs prefix (/usr/bin,
> /usr/local/bin)  and everything else to end up is a gnue directory (or
> below it in as a package)
>   site-packages/gnue
>   site-packages/gnue/forms/*
>   site-packages/gnue/misc/*
> I've found that distutils (1.0.1) doesn't allow mixing packages, modules
> in setup.py so I assume this will require me doing every thing as a
> package.

That's a feature -- it's meant to *encourage* people to put their
modules into packages.  ;-)

But if you still have "legacy" top-level modules, that's OK: just tell
the Distutils to process the "root package".  Eg.

   packages = ['', 'gnue', 'gnue.forms', 'gnue.misc']

Every "root package" module found in your source tree will wind up in
site-packages, unless you specify a .pth file with the 'extra_path'

> But I can't find anything on how to get the main app in
> /usr/local/bin or how to include docs/man pages etc.

For the main app:
   scripts = ['script']

will copy "script" to /usr/local/bin (or whatever the prefix of the
current Python interprerter is), with the #! line fixed to point to the
interpreter used for the build.

Docs and man pages are not handled, because there is no standard
documentation format in the Python world.  That's a bug, but not
one I can fix single-handedly.  ;-(

Greg Ward                               gward@python.net