virtualenv has a neat feature in which it creates a copy of itself with a few more hooks. In your case, hook_ after_install is important, which will be launched immediately after virtualenv installation.
Just create a script with the following contents:
import os, virtualenv extra_text = """ import os, subprocess def after_install(options, home_dir): subprocess.call([ os.path.join(home_dir, 'bin', 'pip'), 'install', '-r', 'relative_path_from_env_home_to_requirements_file', ]) def adjust_options(options, args): if not args: args.append('.') """ output = virtualenv.create_bootstrap_script(extra_text) open('bootstrap.py', 'w').write(output)
And do it. He will create a bootstrap.py file that your colleague must execute in order to download both the virtual file and the necessary packages:
./bootstrap.py --no-site-packages
Virtualenv is created at the root of the project, so before committing, make sure that svn: ignore or .gitignore are created by dirs.
The only drawback to this is that AFAIK is not integrated with virtualenvwrapper. But in any case, the point is to have an environment in the project, and one of virtualenvwrapper is to have an environment in your homedir.
rewritten
source share