[PyQt] Install script for Python applications
Lukas Hetzenecker
LuHe at gmx.at
Sat Dec 12 14:52:47 GMT 2009
Hello,
thank you for your quick answer.
But I don't quite understand distutils.
At the beginning i have some fundamental questions:
- Should whole applications also be installed in
/usr/lib/python2.6/site-packages ?
- Should the wrapper script only execute the main python file in
/usr/lib/python2.6/site-packages/<name>/<name>.py or should
I copy this file to /usr/[local]/bin?
- Where should I place the language files (app_de.qm and qt_de.qm) ?
- What is the standard path for data files? /usr/share/<application> ?
And now to distutils...
I have this folder structure:
<series60-remote-0.4>
<pc>
<devices>
__init__.py
series60.py
<window>
__init__.py
about.py
chat.py
history.py
...
series60-remote.py
<lib>
__init__.py
status_numbers.py
<mobile>
mobile.py
series60-remote.sis
Is it possible to say distutils that it should copy these files to the
following locations:
/usr/lib/python2.6/site-packages
<series60-remote>
<lib>
__init__.py
status_numbers.py
<devices>
__init__.py
series60.py
<window>
__init__.py
about.py
chat.py
history.py
...
series60-remote.py
/usr/share/series60-remote
series60-remote.sis
/usr/bin
series60-remote
Please note that the root folder isn't pc, but series60-remote when it is
installed.
I have the main python file pc/series60-remote.py. is it possible to tell
distutils that it should look in this file and find all modules that it needs
and copy these to /usr/lib/python2.6/site-packages?
Thanks for your help,
Lukas
Am Freitag 11 Dezember 2009 13:37:01 schrieb Darren Dale:
> On Fri, Dec 11, 2009 at 6:11 AM, Lukas Hetzenecker <LuHe at gmx.at> wrote:
> > Hello,
> >
> > I've developed a application using Python and PyQt4.
> > What is the best way to make a install.py / setup.py / Makefile for
> > installing this application?
> >
> > It should check if all depencies are found (this should be really simple:
> > try: import xxx except ImportError: print ""; sys.exit(2) )
> >
> > It should compile and copy all *.py/pyc files to
> > python -c "from distutils.sysconfig import get_python_lib; print
> > get_python_lib()"
> >
> > There are also some files that should be in /usr/share/<appname>
> >
> > A small wrapper script, that is written to /usr/local/bin would also be
> > nice.
> >
> > Is this possible with distutils?
>
> I'd advise using distutils. It supports everything you describe, with
> the exception of dependency checking, which you would have to code
> yourself.
>
> Darren
>
More information about the PyQt
mailing list