[Tutor] Tutorial executable from python script.

Lie Ryan lie.1296 at gmail.com
Sun Mar 21 16:01:02 CET 2010


On 03/21/2010 08:51 PM, Karim Liateni wrote:
> 
> Hello Lie,
> 
> Thanks for your advices.
> 
> To have correct updates from ITs is really a true pain. The network
> is worldwide in our company. I found issues having decent version.
> On my local workstation I have Python v1.5, on compute farm LSF
> machines sometimes 2.2 , 2.3, 2.6. That's why I don't want to rely
> on machine installation and provide a unique version with my
> application installation. I know we did the same for TCL to be sure
> to have 8.4 version. I just wanted to know if there is some tutos about
> this topic.

As Alan have said, if you target your script for python 1.5, it is quite
likely that your script will still run in python 2.6.

Can you describe what's your deployment strategy? Do you have an
automated deployment or do you do it manually? How important is it for
all computer in the network to have identical version of your script? Do
all your servers have the GNU toolchain? How do the servers varies? Do
they all have the same/similar hardware? Do they have a certain common
subset of software? Can you give an estimate of the number of servers in
the network?

In general, it is impossible to have a super-package that can be
deployed uniformly if your servers varies too widely. For example if
most of your server uses x86 but several uses PowerPC, you will have to
include different binaries for them. Or if there is a Windows-based
server. The complexity of having such generic super-packager is similar
to what the automake toolchain faces (in short, extremely complex).

If you can guarantee that all your server contains 'python' however old
it is; you can write the version checking script from the previous post.
If you take some care, the version checking script should run in all
python version from the very ancient to the latest.

If you can guarantee that all your servers run certain version of a type
of Unix, you may be able to pre-compile python in one of the machine and
use this pre-compiled version on all machine. If you have to follow the
local machine directory conventions (e.g. some servers want your script
in /bin while the other in /usr/bin) you may need to write a script that
modify the hashbang line appropriately.

If you can guarantee that your servers have GNU toolchain, you can write
a shell script to check the system python's version and download and
compile python from source if the system's python version doesn't match.



More information about the Tutor mailing list