Beispiel #1
0
 def _install_python_packages(self):
     packages = ['requests']
     pip_path = self._virtualenv_path / 'bin' / 'pip'
     run_shell_command(
         [pip_path.as_posix(), 'install', ' '.join(packages)],
         timeout=conf.virtualenv_creation_timeout,
     )
Beispiel #2
0
 def _install_node_modules_if_needed(self):
     packages = ['unirest']
     if conf.always_create_environments and self._project_dir_path.exists():
         debug(f'Removing {self._project_dir_path}')
         shutil.rmtree(self._project_dir_path.as_posix())
     if not self._project_dir_path.exists():
         os.makedirs(self._project_dir_path.as_posix())
         debug(f'Installing node modules to {self._project_dir_path}')
         run_shell_command(
             ['npm', 'install', ' '.join(packages)],
             timeout=conf.virtualenv_creation_timeout,
             cwd=self._project_dir_path,
         )
Beispiel #3
0
 def _run_sample(self, sample_path: str):
     if self.tmp_sample_path is None:
         raise ValueError('Temporary sample was not created')
     node_bin = 'node'
     return run_shell_command(
         [node_bin, sample_path],
         cwd=self._project_dir_path,
     )
Beispiel #4
0
 def _run_sample(self, sample_path: str):
     return run_shell_command([
         self._python_path.as_posix(),
         sample_path,
     ])
 def _run_sample(self, sample_path: str):
     bash_bin = '/bin/bash'
     return run_shell_command([bash_bin, sample_path])