82 | def create_virtualenv(self, no_site_packages=True): |
83 | """Creates the virtual environment and installs PIP. |
84 | |
85 | Creates the virtual environment and installs PIP only into the |
86 | virtual environment. |
87 | """ |
88 | if not os.path.isdir(self.venv): |
89 | print 'Creating venv...', |
90 | if no_site_packages: |
91 | self.run_command(['virtualenv', '-q', '--no-site-packages', |
92 | self.venv]) |
93 | else: |
94 | self.run_command(['virtualenv', '-q', self.venv]) |
95 | print 'done.' |
96 | print 'Installing pip in venv...', |
97 | if not self.run_command(['tools/with_venv.sh', 'easy_install', |
98 | 'pip>1.0']).strip(): |
99 | self.die("Failed to install pip.") |
100 | print 'done.' |
101 | else: |
102 | print "venv already exists..." |
103 | pass |