I have a Ruby on Rails project, using Python + Scrapy to scrape the web, and I would like to distribute and deploy the Rails project with all Python executables and libraries installed automatically.
The deployment environment ships by default a Python version lower than 2.6, and I would like users not to depend on OS and installed Python executable.
So, basically I want to achieve a Python virtualenv inside my Rails project.
Any ideas on how do that?
I use Capistrano for deploying my Rails project.
Are all your (DTAP) environments using the same operating system and processor architecture?
If not, I wouldn’t recommend shipping the Python interpreter with your project. Why don’t you compile a more recent version of Python on your environments and install it in some non-standard path, like /opt/python27/ (or similiar).
Then, just create a virtualenv on all environments using that interpreter.
Next, you deploy your project from your virtualenv (without the bin, include, etc.) to the virtualenv of the target environment.
I’ve never used Capistrano (Python dev myself), but I’m assuming it can just copy over directories from one environment (or VCS) to the other.