Using "setup.py" for an application, not a library module.
Philip Semanchuk
philip at semanchuk.com
Wed Nov 18 17:17:47 EST 2009
On Nov 18, 2009, at 3:53 PM, John Nagle wrote:
> Most of the documentation for "setup.py" assumes you're packaging a
> library module. (Ref: "http://docs.python.org/distutils/setupscript.html
> ")
> How do you properly package an application? What happens
> on "setup.py install"? Where does the application get installed?
> Where does
> the main program go?
>
> If I package and build my app, it packages properly, and
> unpacks and builds into
>
> Messager1.0/build/lib
>
> which is appropriate for a library, but not an application.
> Here's the setup file.
>
>
> distutils.core.setup(
> name='Messager',
> description="Baudot Teletype RSS and SMS program",
> version='1.0',
> author="John Nagle",
> author_email="nagle at animats.com",
> packages=['messager'],
> requires=['pyserial', 'feedparser']
> )
Hi John,
I'm not sure what part you find unpalatable other than "lib" being in
the pathname. I recently wrote a setup.py for an app called Analysis.
Under OS X, Linux and Windows it installs into the site-packages
directory so I can run it like so:
python C:\Python25\Lib\site-packages\analysis\main.py
or:
python /usr/local/lib/python2.6/dist-packages/analysis/main.py
Now, packaging an application according to the expectations of the
platform to provide a double-clickable icon will require something
like py2exe or py2app. distutils doesn't provide a facility for that.
DOes that give you an idea about what you were asking?
bye
Philip
More information about the Python-list
mailing list