def _install_setuptools_and_zc_buildout(self): from os.path import join, exists from os import environ, remove with utils.open_buildout_configfile() as buildout: cachedir = buildout.get("buildout", "download-cache") cache_dist = join(cachedir, "dist") cmd = [] packages = [] # in case dependencies are frozen, we need to use the frozen version of setuptools and zc.buildout with utils.open_buildout_configfile() as buildout: for package in ['setuptools', 'zc.buildout', 'pip']: if buildout.has_option("versions", package): packages += [ '{}=={}'.format(package, buildout.get("versions", package)) ] else: packages += [package] env = environ.copy() env['PYTHONPATH'] = '' utils.execute_assert_success([ utils.get_isolated_executable('python'), 'get-pip.py', '--prefix=%s' % join('parts', 'python') ] + packages, env=env) remove('get-pip.py') utils.execute_assert_success([ utils.get_isolated_executable('pip'), 'download', '--dest', cache_dist ] + packages, env=env)
def bootstrap_if_necessary(self): from os.path import join from pkg_resources import resource_filename from infi.projector.plugins.builtins.repository import skeleton buildout_executable_exists = assertions.is_executable_exists(join("bin", "buildout")) if not buildout_executable_exists or self.arguments.get("--force-bootstrap", False) or self.arguments.get("--newest", False): try: utils.execute_assert_success([utils.get_executable('buildout'), 'bootstrap']) except OSError: # workaround for OSX utils.execute_assert_success(['buildout', 'bootstrap'])
def install_isolated_python_if_necessary(self): from os import environ if not self.arguments.get("--use-isolated-python", False): return self._remove_setuptools_egg_link() if not assertions.is_isolated_python_exists() or self.arguments.get("--newest", False): with utils.buildout_parameters_context(['buildout:develop=', 'buildout:versions=no', 'no:key=value']): utils.execute_with_buildout("install {}".format(self.get_isolated_python_section_name())) self._get_pip() self._install_setuptools_and_zc_buildout() env = environ.copy() env['PYTHONPATH'] = '' utils.execute_assert_success([utils.get_isolated_executable('buildout'), 'bootstrap'], env=env)
def bootstrap_if_necessary(self): from os.path import join, split from os import name from sys import argv from pkg_resources import resource_filename from infi.projector.plugins.builtins.repository import skeleton buildout_executable_exists = assertions.is_executable_exists(join("bin", "buildout")) if not buildout_executable_exists or self.arguments.get("--force-bootstrap", False) or self.arguments.get("--newest", False): try: return utils.execute_assert_success([utils.get_executable('buildout'), 'bootstrap']) except OSError: # workaround for OSX pass try: utils.execute_assert_success(['buildout', 'bootstrap']) except OSError: dirname, basename = split(argv[0]) buildout = join(dirname, 'buildout.exe' if name == 'nt' else 'buildout') utils.execute_assert_success([buildout, 'bootstrap'])
def bootstrap_if_necessary(self): from os.path import join, split from os import name from sys import argv from pkg_resources import resource_filename from infi.projector.plugins.builtins.repository import skeleton buildout_executable_exists = assertions.is_executable_exists( join("bin", "buildout")) if not buildout_executable_exists or self.arguments.get( "--force-bootstrap", False) or self.arguments.get( "--newest", False): try: return utils.execute_assert_success( [utils.get_executable('buildout'), 'bootstrap']) except OSError: # workaround for OSX pass try: utils.execute_assert_success(['buildout', 'bootstrap']) except OSError: dirname, basename = split(argv[0]) buildout = join(dirname, 'buildout.exe' if name == 'nt' else 'buildout') utils.execute_assert_success([buildout, 'bootstrap'])
def _install_setuptools_and_zc_buildout(self): from os.path import join, exists from os import environ, remove with utils.open_buildout_configfile() as buildout: cachedir = buildout.get("buildout", "download-cache") cache_dist = join(cachedir, "dist") cmd = [] packages = [] # in case dependencies are frozen, we need to use the frozen version of setuptools and zc.buildout with utils.open_buildout_configfile() as buildout: for package in ['setuptools', 'zc.buildout', 'pip']: if buildout.has_option("versions", package): packages += ['{}=={}'.format(package, buildout.get("versions", package))] else: packages += [package] env = environ.copy() env['PYTHONPATH'] = '' utils.execute_assert_success([utils.get_isolated_executable('python'), 'get-pip.py', '--prefix=%s' % join('parts', 'python')] + packages, env=env) remove('get-pip.py') utils.execute_assert_success([utils.get_isolated_executable('python'), '-m', 'pip', 'download', '--dest', cache_dist] + packages, env=env)