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:
- download application source
- run script fetch specific module dependencies if not present (perhaps using pip)
- 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.
you want repeatable install/build system developers.
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
Post a Comment