MCPcopy Index your code
hub / github.com/certbot/certbot / install_packages

Function install_packages

tools/venv.py:187–217  ·  view source on GitHub ↗

Installs packages in the given venv. :param str venv_name: The name or path at where the virtual environment should be created. :param pip_args: Command line arguments that should be given to pip to install packages :type pip_args: `list` of `str`

(venv_name, pip_args)

Source from the content-addressed store, hash-verified

185
186
187def install_packages(venv_name, pip_args):
188 """Installs packages in the given venv.
189
190 :param str venv_name: The name or path at where the virtual
191 environment should be created.
192 :param pip_args: Command line arguments that should be given to
193 pip to install packages
194 :type pip_args: `list` of `str`
195
196 """
197 # Using the python executable from venv, we ensure to execute following commands in this venv.
198 py_venv = get_venv_python_path(venv_name)
199 command = [py_venv, os.path.abspath('tools/pip_install.py')]
200 command.extend(pip_args)
201 subprocess_with_print(command)
202
203 if os.path.isdir(os.path.join(venv_name, 'bin')):
204 # Linux/OSX specific
205 print('-------------------------------------------------------------------')
206 print('Please run the following command to activate developer environment:')
207 print('source {0}/bin/activate'.format(venv_name))
208 print('-------------------------------------------------------------------')
209 elif os.path.isdir(os.path.join(venv_name, 'Scripts')):
210 # Windows specific
211 print('---------------------------------------------------------------------------')
212 print('Please run one of the following commands to activate developer environment:')
213 print('{0}\\Scripts\\activate.bat (for Batch)'.format(venv_name))
214 print('.\\{0}\\Scripts\\Activate.ps1 (for Powershell)'.format(venv_name))
215 print('---------------------------------------------------------------------------')
216 else:
217 raise ValueError('Error, directory {0} is not a valid venv.'.format(venv_name))
218
219
220def create_venv(venv_path):

Callers 1

mainFunction · 0.85

Calls 4

get_venv_python_pathFunction · 0.85
subprocess_with_printFunction · 0.85
extendMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected