I am new to the dev-ops side of things, and I've been working to get a Python application packaged into an RPM (using python setup.py bdist_rpm) deployed onto a centos VM via Yum. Chef is used to manage the VM. The Python app will run within a virtualenv, as part of a continuous deployment process.
Should the RPM be smart and self-contained, performing such operations as creating/starting the virtualenv environment, pip-installing required dependencies and then finally configuring an init process (in this case to kick off a uwsgi REST server process for the virtualenv)?
Or, should the Chef recipe manage building the virtualenv and pip-installing dependencies, with the RPM itself doing a simple 'python setup.py install' to load my Python modules into the virtualenv's pythonX.Y/site-packages folder?
A follow on 'yum install/reinstall ' call (say via an automated process) would work for either approach, but the former requires a more complex RPM which may not be 'best practice', correct? The former does allow for a self-contained install that could be more cleanly removed later, and better separates concerns between developer (Python) and dev-ops (Chef). Please advise on what is 'typically' done.