Vagrant up an official cloud 14.04. Vagrant ssh in, then
sudo apt-get -y install git gcc libz-dev libreadline-dev libbz2-dev libsqlite3-dev libssl-dev ruby-dev
git clone https://github.com/yyuu/pyenv-installer
cd pyenv-installer; bin/pyenv-installer
Add this to the user's .bash_profile:
# Load pyenv automatically by adding
# the following to ~/.bash_profile:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Logout/login to get a new shell, etc.
Now continue to build a python in the pyenv:
. .bashrc
pyenv install 2.7.10
pyenv virtualenv 2.7.10 some-project
pyenv global some-project
Now for the fpm part:
sudo gem install fpm
fpm -v 0.0.1 -n some-project_pyenv -s dir -t deb $PWD/.bash_profile $PWD/.pyenv
Add in some depdencies, and this seems to create reproducable builds of python and modules.