views:

1280

answers:

5

I have a Python web application consisting of several Python packages. What is the best way of building and deploying this to the servers?

Currently I'm deploying the packages with Capistrano, installing the packages into a virtualenv with bash, and configuring the servers with puppet, but I would like to go for a more Python based solution.

I've been looking a bit into zc.buildout, but it's not clear for me what I can/should use it for.

A: 

Would SCons do what you want?

http://www.scons.org/

mmaibaum
A: 

pyinstall looks like it should be a simpler solution for you. At least as far as packaging the python stuff and installing in virtualenv goes. I don't know of a pythonic way to do server configuration...

Ryan
A: 

Paver is a rake/make work alike for python. I don't know if this is what your looking for, still haven't found anything equivalent to puppet for python...

Ryan
A: 

I use Mercurial as my SCM system, and also for deployment too. It's just a matter of cloning the repository from another one, and then a pull/update or a fetch will get it up to date.

I use several instances of the repository - one on the development server, one (or more, depending upon circumstance) on my local machine, one on the production server, and one 'Master' repository that is available to the greater internet (although only by SSH).

The only thing it doesn't do is automatically update the database if it is changed, but with incoming hooks I could probably do this too.

Matthew Schinckel
If You're using SCM, does it mean that You're having minified files in repository? Builded PO files too? So after every source code commit, commiter must also rebuild binary/derived files and commit them too?
Almad
Actually, the minified/cached versions of the files are generated on the server, using django-css.
Matthew Schinckel
+1  A: 

Depends on what Your infrastructure is. We're just using debian packages and buildbot to make them.

On other setups, I use Fabric scripts. As for format, I'm just using tbz2 files, but I've heard about people just depoloying eggs.

I'd strongly recommend having proper build and having BuildBot/Hudson to build packages, as using SCM beats the purpose and encourage bad practices.

Almad