With patching Python code, there is always the option of dynamically
modifying the code at run-time ... aka doing it monkey style. You can
do this in a bit more orderly fashion by using something like the
'monkey' package, which lets you use a signature on the function being
packaged, so that you become aware when you update the code being
patched that it's not longer the same code.

http://pypi.python.org/pypi/monkey

But beyond that, PIP is probably not the right tool for applying
patches. It's probably also not the right tool for setting up
databases, configuring LDAP, cleaning the cats liter, etc. I use
Buildout for this. Which a number of people use in conjunction with
virtualenv and pip (there is a Buildout recipe for driving pip for
example). Although there are also recipes which let you manage
packages in an isolated fashion without using virtualenv+pip - which
is usually what I do since they allow you to re-use the same packages
between deployments. I think if I installed all the deployments on my
machine using PIP where the code is repeated for every deployment I
would run out of i-nodes.

Anyways, patching in Buildout, that is patching C code, etc. ... aka
real patching or manly patching, is usually done with a 'configure;
make; make install;' recipe. With the zc.recipe.cmmi (http://
pypi.python.org/pypi/zc.recipe.cmmi) this looks like:

[buildout]
parts = foo

[foo]
recipe = zc.recipe.cmmi
url = http://url-path/to/some-file.tgz
patch = ${buildout:directory}/patches/config.patch
patch_options = -p0

I haven't actually used Fabric yet (keep meaning to switch some
deployments over some day, but I guess I'm too busy doing manuall
deployments to have time for this ;P), but it's my understanding this
is a tool for executing remote commands (e.g. commands to invoke pip
or buildout). I guess you can always accomplish quite a bit with BASH
commands, but I much prefer Buildout as it's a declarative
configuration system as opposed to an imperative series of commands.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to