virtualenv - Distributing a python package along with module dependencies using RPM -


i've got several python applications consisting of scripts/modules should packaged , deployed rpms.

the trickier bit each application should distributed along python module dependencies, , these should used in preference installed system wide.

the target hosts of these rpms have limited network access, rpms should contain needed run app, rather downloading @ deploy time.

i've looked @ packaging , distributing virtualenv, relocating virtualenv doesn't seem supported.

i've looked @ zc.buildout, found documentation lacking. see how download dependencies during development, not how distribute them part of larger application. it's possible different apps require different versions of same module, these shouldn't installed system wide.

another pain point python scripts in app need modified use different sys.path during development , after deployment, couldn't see obvious way around this.

are suggestions on how best achieve this? ideal summary of workflow developer's point of view like:

  1. download application source
  2. run script fetch specific module dependencies if not present (perhaps using pip)
  3. run script build python app, , package , downloaded dependencies rpm

the final rpm should installable , runnable on host no network access, , python interpreter installed.

i'd see 2 separate problems.

  1. you want repeatable install/build system developers.

  2. you want installer builder.

buildout (or pip, perhaps in combination script) can take care of first problem. basically: "how project ready development on fresh laptop". ideally you'd python bootstrap.py;bin/buildout , ready (same pip/virtualenv).

now have repeatable build, can use basis installer. handiest clean virtual machine use purpose. virtualbox/vagrant, instance. make scripts set virtualbox , install proper dependencies in there.

the installer builder script can make fresh checkout of project inside virtualbox , repeatable build thingy in location want have in installer (/opt/yourproject, instance).

then use fpm make actual package (.deb, .rpm, whatever). pass in fpm options tells necessary dependencies, way can sure dependencies installed. (note: these os-level dependencies memcached or postgres; python dependencies should handled pip or buildout).

if split big problem in these 2 smaller problems, both can attacked separately.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -