I've got several python applications consisting of scripts/modules that should be packaged and deployed as RPMs.
The trickier bit is that each application should be distributed along with all python module dependencies, and these should be used in preference to any that are installed system wide.
The target hosts for some of these RPMs have limited network access, so the RPMs should contain everything needed to run the app, rather than downloading anything at deploy time.
I've looked at packaging and distributing a virtualenv, but relocating a virtualenv doesn't seem to be well supported.
I've looked at zc.buildout, but found the documentation to be lacking. I could see how to download dependencies during development, but not how to distribute them as part of a larger application. It's possible different apps require different versions of the same module, so these shouldn't be installed system wide.
Another pain point is that any python scripts in the app need to be modified to use a different sys.path during development and after deployment, I couldn't see an obvious way around this.
Are suggestions on how best to achieve this? An ideal summary of the workflow from a developer's point of view would look like:
- download application source
- run script to fetch specific module dependencies if not present (perhaps using pip)
- run script to build python app, and package it and all downloaded dependencies into RPM
The final RPM should then be installable and runnable on a host with no network access, and only a python interpreter installed.